Skip to content

Commit a118902

Browse files
committed
Workarounds for undefined reference to environ
1 parent c349d70 commit a118902

File tree

8 files changed

+44
-0
lines changed

8 files changed

+44
-0
lines changed

winsup/testsuite/winsup.api/ltp/execle01.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ int exp_enos[]={0, 0}; /* Zero terminated list of expected errnos */
133133

134134
int pid; /* process id from fork */
135135
int status; /* status returned from waitpid */
136+
137+
#if defined(__aarch64__)
138+
__attribute__((dllimport)) /* workaround for large relocation issue in binutils */
139+
#endif
136140
extern char **environ; /* pointer to this processes env, to pass along */
137141

138142
int

winsup/testsuite/winsup.api/ltp/execve01.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ int exp_enos[]={0, 0}; /* Zero terminated list of expected errnos */
134134
int pid; /* process id from fork */
135135
int status; /* status returned from waitpid */
136136
char *const args[2]={"/usr/bin/test", 0}; /* argument list for execve call */
137+
138+
#if defined(__aarch64__)
139+
__attribute__((dllimport)) /* workaround for large relocation issue in binutils */
140+
#endif
137141
extern char **environ; /* pointer to this processes env, to pass along */
138142

139143
int

winsup/testsuite/winsup.api/posix_spawn/chdir.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
#include <string.h>
88
#include <unistd.h>
99

10+
/* Workaround for large relocation issue in binutils. */
11+
#if defined(__aarch64__)
12+
__attribute__((dllimport))
13+
extern char **environ;
14+
#endif
15+
1016
/* Linux is behind the times a bit (also needs the *chdir_np functions) */
1117
#ifndef O_SEARCH
1218
# define O_SEARCH O_PATH

winsup/testsuite/winsup.api/posix_spawn/errors.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
#include <sys/stat.h>
77
#include <unistd.h>
88

9+
/* Workaround for large relocation issue in binutils. */
10+
#if defined(__aarch64__)
11+
__attribute__((dllimport))
12+
extern char **environ;
13+
#endif
14+
915
static char tmppath[] = "pspawn.XXXXXX";
1016
static const char exit0[] = "exit 0\n";
1117

winsup/testsuite/winsup.api/posix_spawn/fds.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
#include <string.h>
88
#include <unistd.h>
99

10+
/* Workaround for large relocation issue in binutils. */
11+
#if defined(__aarch64__)
12+
__attribute__((dllimport))
13+
extern char **environ;
14+
#endif
15+
1016
int handle_child (char *devfd, char *target)
1117
{
1218
char buf[PATH_MAX];

winsup/testsuite/winsup.api/posix_spawn/signals.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
#include <string.h>
77
#include <unistd.h>
88

9+
/* Workaround for large relocation issue in binutils. */
10+
#if defined(__aarch64__)
11+
__attribute__((dllimport))
12+
extern char **environ;
13+
#endif
14+
915
int handle_child (char *arg)
1016
{
1117
struct sigaction sa;

winsup/testsuite/winsup.api/posix_spawn/win32.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
#include <sys/cygwin.h>
1010
#include <unistd.h>
1111

12+
/* Workaround for large relocation issue in binutils. */
13+
#if defined(__aarch64__)
14+
__attribute__((dllimport))
15+
extern char **environ;
16+
#endif
17+
1218
char * find_winchild (void)
1319
{
1420
static const char winchild[] = "/winchild";

winsup/utils/newgrp.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ details. */
2525

2626
#define PATH_PREFIX "PATH=/usr/bin:"
2727

28+
/* Workaround for large relocation issue in binutils. */
29+
#if defined(__aarch64__)
30+
__attribute__((dllimport))
31+
extern char **environ;
32+
#endif
33+
2834
char *
2935
create_env_var (const char *name, const char *val)
3036
{

0 commit comments

Comments
 (0)