Fix Windows-x-PPC build

A recent BFD change caused a build failure for a Windows->PPC cross:

ld.exe: ../bfd/libbfd.a(coff-rs6000.o):coff-rs6000.c:(.text+0x4571): undefined reference to `getuid'
ld.exe: ../bfd/libbfd.a(coff-rs6000.o):coff-rs6000.c:(.text+0x457e): undefined reference to `getgid'

This patch fixes the problem by moving the replacement definitions of
getuid and getgid to system.h.

bfd/ChangeLog
2020-11-11  Tom Tromey  <tromey@adacore.com>

	* archive.c (getuid, getgid): Move...
	* sysdep.h (getuid, getgid): ...here.
This commit is contained in:
Tom Tromey 2020-11-10 09:15:31 -07:00
parent 550820e16d
commit 0dd7428d89
3 changed files with 13 additions and 8 deletions

View File

@ -1,3 +1,8 @@
2020-11-11 Tom Tromey <tromey@adacore.com>
* archive.c (getuid, getgid): Move...
* sysdep.h (getuid, getgid): ...here.
2020-11-09 Alan Modra <amodra@gmail.com>
* vms-alpha.c (alpha_vms_write_exec): Write 16 bits to eihd.alias.

View File

@ -1842,14 +1842,6 @@ hpux_uid_gid_encode (char str[6], long int id)
}
#endif /* HPUX_LARGE_AR_IDS */
#ifndef HAVE_GETUID
#define getuid() 0
#endif
#ifndef HAVE_GETGID
#define getgid() 0
#endif
/* Takes a filename, returns an arelt_data for it, or NULL if it can't
make one. The filename must refer to a filename in the filesystem.
The filename field of the ar_hdr will NOT be initialized. If member

View File

@ -223,4 +223,12 @@ size_t strnlen (const char *, size_t);
# define N_(String) (String)
#endif
#ifndef HAVE_GETUID
#define getuid() 0
#endif
#ifndef HAVE_GETGID
#define getgid() 0
#endif
#endif /* ! defined (BFD_SYSDEP_H) */