aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2020-11-10 09:15:31 -0700
committerTom Tromey <tromey@adacore.com>2020-11-11 06:38:43 -0700
commit0dd7428d895b35121db434dd0432d810ef6eecbe (patch)
tree7c178aab2e67ef746083267077c0ccc4ed03e5ca
parent550820e16d0a1f44ee63086b1a2d931e04839ffa (diff)
downloadgdb-0dd7428d895b35121db434dd0432d810ef6eecbe.zip
gdb-0dd7428d895b35121db434dd0432d810ef6eecbe.tar.gz
gdb-0dd7428d895b35121db434dd0432d810ef6eecbe.tar.bz2
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.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/archive.c8
-rw-r--r--bfd/sysdep.h8
3 files changed, 13 insertions, 8 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 81d84e6..8e5822f 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -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.
diff --git a/bfd/archive.c b/bfd/archive.c
index 1836b9b..0250d6f 100644
--- a/bfd/archive.c
+++ b/bfd/archive.c
@@ -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
diff --git a/bfd/sysdep.h b/bfd/sysdep.h
index 6528571..3891f97 100644
--- a/bfd/sysdep.h
+++ b/bfd/sysdep.h
@@ -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) */