Skip to content

Commit

Permalink
Fix hurd build with hidden support
Browse files Browse the repository at this point in the history
	* hurd/sigunwind.c (_hurdsig_longjmp_from_handler): Destroy reply port
	of interrupted RPC instead of restoring it.

	* sysdeps/i386/setjmp.S (__sigsetjmp): Add hidden_def.
	* sysdeps/mach/hurd/accept4.c (__libc_accept4): Remove
	libc_hidden_def.
	* sysdeps/mach/hurd/dl-sysdep.c (__libc_stack_end): Add relro
	attribute, define rtld_hidden_data_def.
	* sysdeps/mach/hurd/fxstatat64.c (__fxstatat64): Add libc_hidden_def.
	* sysdeps/mach/hurd/if_index.c (__if_freenameindex): Add
	libc_hidden_def.
	(if_freenameindex): Add libc_hidden_weak.
	(if_nameindex): Add libc_hidden_weak.
	* sysdeps/mach/hurd/open.c (_open64): Rename libc_hidden_weak into
	__open64.
	* sysdeps/mach/hurd/sigwait.c (__sigwait): Add libc_hidden_def.
	* sysdeps/mach/hurd/xmknodat.c (__xmknodat): Add libc_hidden_def.
	* sysdeps/mach/nanosleep.c: Include <time.h>
	(__nanosleep): Rename to __libc_nanosleep.
	(__nanosleep): Add weak_alias.
	(nanosleep): Update alias.
	* sysdeps/mach/hurd/configure.ac (NO_HIDDEN): Do not define.
	* sysdeps/mach/hurd/configure: Regenerate.
  • Loading branch information
Samuel Thibault committed Nov 25, 2015
1 parent fb30403 commit 6e45e6e
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 11 deletions.
21 changes: 21 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,27 @@
* hurd/sigunwind.c (_hurdsig_longjmp_from_handler): Destroy reply port
of interrupted RPC instead of restoring it.

* sysdeps/i386/setjmp.S (__sigsetjmp): Add hidden_def.
* sysdeps/mach/hurd/accept4.c (__libc_accept4): Remove
libc_hidden_def.
* sysdeps/mach/hurd/dl-sysdep.c (__libc_stack_end): Add relro
attribute, define rtld_hidden_data_def.
* sysdeps/mach/hurd/fxstatat64.c (__fxstatat64): Add libc_hidden_def.
* sysdeps/mach/hurd/if_index.c (__if_freenameindex): Add
libc_hidden_def.
(if_freenameindex): Add libc_hidden_weak.
(if_nameindex): Add libc_hidden_weak.
* sysdeps/mach/hurd/open.c (_open64): Rename libc_hidden_weak into
__open64.
* sysdeps/mach/hurd/sigwait.c (__sigwait): Add libc_hidden_def.
* sysdeps/mach/hurd/xmknodat.c (__xmknodat): Add libc_hidden_def.
* sysdeps/mach/nanosleep.c: Include <time.h>
(__nanosleep): Rename to __libc_nanosleep.
(__nanosleep): Add weak_alias.
(nanosleep): Update alias.
* sysdeps/mach/hurd/configure.ac (NO_HIDDEN): Do not define.
* sysdeps/mach/hurd/configure: Regenerate.

2015-11-24 Joseph Myers <joseph@codesourcery.com>

* stdlib/strtod_nan.c: New file.
Expand Down
1 change: 1 addition & 0 deletions sysdeps/i386/setjmp.S
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ ENTRY (__sigsetjmp)
jmp __sigjmp_save
#endif
END (__sigsetjmp)
hidden_def (__sigsetjmp)
1 change: 0 additions & 1 deletion sysdeps/mach/hurd/accept4.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,4 @@ __libc_accept4 (int fd, __SOCKADDR_ARG addrarg, socklen_t *addr_len, int flags)

return _hurd_intern_fd (new, O_IGNORE_CTTY | flags, 1);
}
libc_hidden_def (__libc_accept4)
weak_alias (__libc_accept4, accept4)
3 changes: 0 additions & 3 deletions sysdeps/mach/hurd/configure
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# This file is generated from configure.ac by Autoconf. DO NOT EDIT!

$as_echo "#define NO_HIDDEN 1" >>confdefs.h


if test -n "$sysheaders"; then
OLD_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
Expand Down
3 changes: 0 additions & 3 deletions sysdeps/mach/hurd/configure.ac
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.

dnl We need this setting because of the need for PLT calls in ld.so.
AC_DEFINE([NO_HIDDEN])

if test -n "$sysheaders"; then
OLD_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
Expand Down
3 changes: 2 additions & 1 deletion sysdeps/mach/hurd/dl-sysdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ rtld_hidden_data_def (__libc_enable_secure)
int __libc_multiple_libcs = 0; /* Defining this here avoids the inclusion
of init-first. */
/* This variable contains the lowest stack address ever used. */
void *__libc_stack_end;
void *__libc_stack_end attribute_relro = NULL;
rtld_hidden_data_def(__libc_stack_end)

#if HP_TIMING_AVAIL
hp_timing_t _dl_cpuclock_offset;
Expand Down
1 change: 1 addition & 0 deletions sysdeps/mach/hurd/fxstatat64.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ __fxstatat64 (int vers, int fd, const char *filename, struct stat64 *buf,

return __hurd_fail (err);
}
libc_hidden_def (__fxstatat64)
3 changes: 3 additions & 0 deletions sysdeps/mach/hurd/if_index.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ __if_freenameindex (struct if_nameindex *ifn)
}
free (ifn);
}
libc_hidden_def (__if_freenameindex)
weak_alias (__if_freenameindex, if_freenameindex)
libc_hidden_weak (if_freenameindex)

/* Return an array of if_nameindex structures, one for each network
interface present, plus one indicating the end of the array. On
Expand Down Expand Up @@ -152,6 +154,7 @@ __if_nameindex (void)
return idx;
}
weak_alias (__if_nameindex, if_nameindex)
libc_hidden_weak (if_nameindex)

/* Store the name of the interface corresponding to index IFINDEX in
IFNAME (which has space for at least IFNAMSIZ characters). Return
Expand Down
2 changes: 1 addition & 1 deletion sysdeps/mach/hurd/open.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ weak_alias (__libc_open, open)
/* open64 is just the same as open for us. */
weak_alias (__libc_open, __libc_open64)
weak_alias (__libc_open, __open64)
libc_hidden_weak (_open64)
libc_hidden_weak (__open64)
weak_alias (__libc_open, open64)
1 change: 1 addition & 0 deletions sysdeps/mach/hurd/sigwait.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,5 @@ __sigwait (const sigset_t *set, int *sig)
return 0;
}

libc_hidden_def (__sigwait)
weak_alias (__sigwait, sigwait)
2 changes: 2 additions & 0 deletions sysdeps/mach/hurd/xmknodat.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,5 @@ __xmknodat (int vers, int fd, const char *path, mode_t mode, dev_t *dev)
return __hurd_fail (err);
return 0;
}

libc_hidden_def (__xmknodat)
6 changes: 4 additions & 2 deletions sysdeps/mach/nanosleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@
#include <errno.h>
#include <mach.h>
#include <sys/time.h>
#include <time.h>
#include <unistd.h>

int
__nanosleep (const struct timespec *requested_time,
__libc_nanosleep (const struct timespec *requested_time,
struct timespec *remaining)
{
mach_port_t recv;
Expand Down Expand Up @@ -64,5 +65,6 @@ __nanosleep (const struct timespec *requested_time,

return 0;
}
weak_alias(__libc_nanosleep, __nanosleep)
libc_hidden_def (__nanosleep)
weak_alias (__nanosleep, nanosleep)
weak_alias (__libc_nanosleep, nanosleep)

0 comments on commit 6e45e6e

Please sign in to comment.