Skip to content

Commit

Permalink
Allow sys/auxv.h to be used from the testsuite on powerpc and sparc.
Browse files Browse the repository at this point in the history
elf/tst-auxv.c includes misc/sys/auxv.h, which ends up not actually
being included due to the guard overlap, and getauxval becomes an
implicit declaration and implicit pointer conversion which means, at
best, the test isn't actually testing what it thinks it is and, at
worst, it'll crash and burn on platforms where implict pointer
conversion is a Very Bad Thing.

	* sysdeps/powerpc/bits/hwcap.h: Allow _SYSDEPS_SYSDEP_H guard as a
	synonym for _SYS_AUXV_H to allow direct inclusion.
	* sysdeps/sparc/bits/hwcap.h: Likewise.
	* sysdeps/powerpc/sysdep.h: Define _SYSDEPS_SYSDEP_H instead of
	_SYS_AUXV_H so we can include sysdep.h and sys/auxv.h together.
	* sysdeps/sparc/sysdep.h: Likewise.
  • Loading branch information
Adam Conrad committed Feb 21, 2014
1 parent b8cd1c4 commit 105fa38
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
9 changes: 9 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2014-02-21 Adam Conrad <adconrad@0c3.net>

* sysdeps/powerpc/bits/hwcap.h: Allow _SYSDEPS_SYSDEP_H guard as a
synonym for _SYS_AUXV_H to allow direct inclusion.
* sysdeps/sparc/bits/hwcap.h: Likewise.
* sysdeps/powerpc/sysdep.h: Define _SYSDEPS_SYSDEP_H instead of
_SYS_AUXV_H so we can include sysdep.h and sys/auxv.h together.
* sysdeps/sparc/sysdep.h: Likewise.

2014-02-21 Siddhesh Poyarekar <siddhesh@redhat.com>

* benchtests/bench-strrchr.c (do_test): Fix minor formatting.
Expand Down
2 changes: 1 addition & 1 deletion sysdeps/powerpc/bits/hwcap.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */

#ifndef _SYS_AUXV_H
#if !defined(_SYS_AUXV_H) && !defined(_SYSDEPS_SYSDEP_H)
# error "Never include <bits/hwcap.h> directly; use <sys/auxv.h> instead."
#endif

Expand Down
2 changes: 1 addition & 1 deletion sysdeps/powerpc/sysdep.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* Powerpc Feature masks for the Aux Vector Hardware Capabilities (AT_HWCAP).
* This entry is copied to _dl_hwcap or rtld_global._dl_hwcap during startup.
*/
#define _SYS_AUXV_H 1
#define _SYSDEPS_SYSDEP_H 1
#include <bits/hwcap.h>

#define PPC_FEATURE_970 (PPC_FEATURE_POWER4 + PPC_FEATURE_HAS_ALTIVEC)
Expand Down
2 changes: 1 addition & 1 deletion sysdeps/sparc/bits/hwcap.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */

#ifndef _SYS_AUXV_H
#if !defined(_SYS_AUXV_H) && !defined(_SYSDEPS_SYSDEP_H)
# error "Never include <bits/hwcap.h> directly; use <sys/auxv.h> instead."
#endif

Expand Down
2 changes: 1 addition & 1 deletion sysdeps/sparc/sysdep.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */

#define _SYS_AUXV_H 1
#define _SYSDEPS_SYSDEP_H 1
#include <bits/hwcap.h>

#ifdef __ASSEMBLER__
Expand Down

0 comments on commit 105fa38

Please sign in to comment.