mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-10 02:55:55 +02:00
glibc: Fix build on ARM architectures.
This commit is contained in:
@@ -107,13 +107,8 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
|
||||
@rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
|
||||
@mkdir $(DIR_SRC)/glibc-build
|
||||
ifeq "$(MACHINE_TYPE)" "arm"
|
||||
cd $(DIR_APP) && tar jxf $(DIR_DL)/glibc-ports-$(VER).tar.bz2
|
||||
cd $(DIR_APP) && mv -v glibc-ports-$(VER) ports
|
||||
|
||||
cd $(DIR_APP)/ports && patch -Np1 -i $(DIR_SRC)/src/patches/glibc-ports-avoid-using-asm-procinfo.patch
|
||||
|
||||
# asm/page.h should not be included in sysdeps/unix/sysv/linux/arm/ioperm.c.
|
||||
cd $(DIR_APP) && sed "/asm\/page.h/d" -i ports/sysdeps/unix/sysv/linux/arm/ioperm.c
|
||||
cd $(DIR_APP) && tar jxf $(DIR_DL)/glibc-ports-$(PORTS_VER).tar.bz2
|
||||
cd $(DIR_APP) && mv -v glibc-ports-$(PORTS_VER) ports
|
||||
endif
|
||||
|
||||
ifeq "$(ROOT)" ""
|
||||
|
||||
@@ -1,340 +0,0 @@
|
||||
#
|
||||
# Submitted-By: Marc Kleine-Budde, 2006-11-22
|
||||
# Committed-By: Marc Kleine-Budde
|
||||
#
|
||||
# Error:
|
||||
#
|
||||
# try to compile glibc-ports with sanitized headers
|
||||
#
|
||||
# arm-v4t-linux-gnueabi-gcc ../ports/sysdeps/arm/eabi/setfpucw.c -c
|
||||
#-std=gnu99 -O2 -Wall -Winline -Wwrite-strings -fmerge-all-constants
|
||||
#-g -Wstrict-prototypes -Wno-uninitialized -D__NO_MATH_INLINES
|
||||
#-D__LIBC_INTERNAL_MATH_INLINES -DNO_LONG_DOUBLE
|
||||
#-D_Mlong_double_=double -I../include
|
||||
#-I/home/mkl/pengutronix/ptxdist/build/OSELAS.Toolchain-trunk-headers/build-target/glibc-2.5-build/math
|
||||
#-I/home/mkl/pengutronix/ptxdist/build/OSELAS.Toolchain-trunk-headers/build-target/glibc-2.5-build
|
||||
#-I../ports/sysdeps/arm/elf
|
||||
#-I../ports/sysdeps/unix/sysv/linux/arm/eabi/nptl
|
||||
#-I../ports/sysdeps/unix/sysv/linux/arm/eabi
|
||||
#-I../ports/sysdeps/unix/sysv/linux/arm/nptl
|
||||
#-I../ports/sysdeps/unix/sysv/linux/arm
|
||||
#-I../ports/sysdeps/unix/sysv/linux -I../nptl/sysdeps/unix/sysv/linux
|
||||
#-I../nptl/sysdeps/pthread -I../sysdeps/pthread
|
||||
#-I../sysdeps/unix/sysv/linux -I../sysdeps/gnu
|
||||
#-I../sysdeps/unix/common -I../sysdeps/unix/mman
|
||||
#-I../sysdeps/unix/inet -I../ports/sysdeps/unix/sysv
|
||||
#-I../nptl/sysdeps/unix/sysv -I../sysdeps/unix/sysv
|
||||
#-I../ports/sysdeps/unix/arm -I../ports/sysdeps/unix
|
||||
#-I../nptl/sysdeps/unix -I../sysdeps/unix -I../sysdeps/posix
|
||||
#-I../ports/sysdeps/arm/eabi -I../ports/sysdeps/arm/nptl
|
||||
#-I../ports/sysdeps/arm -I../sysdeps/wordsize-32
|
||||
#-I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754/dbl-64
|
||||
#-I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic
|
||||
#-I../ports -I../nptl -I.. -I../libio -I. -nostdinc -isystem
|
||||
#/ptx/work/mkl/ptxdist/build/OSELAS.Toolchain-trunk-headers/install/arm-v4t-linux-gnueabi/gcc-4.1.1-glibc-2.5-linux-2.6.19-rc6-s/bin/../lib/gcc/arm-v4t-linux-gnueabi/4.1.1/include
|
||||
#-isystem
|
||||
#/home/mkl/pengutronix/ptxdist/build/OSELAS.Toolchain-trunk-headers/install/arm-v4t-linux-gnueabi/gcc-4.1.1-glibc-2.5-linux-2.6.19-rc6-s/sysroot-arm-v4t-linux-gnueabi/usr/include
|
||||
#-D_LIBC_REENTRANT -include ../include/libc-symbols.h -o
|
||||
#/home/mkl/pengutronix/ptxdist/build/OSELAS.Toolchain-trunk-headers/build-target/glibc-2.5-build/math/setfpucw.o
|
||||
#-MD -MP -MF
|
||||
#/home/mkl/pengutronix/ptxdist/build/OSELAS.Toolchain-trunk-headers/build-target/glibc-2.5-build/math/setfpucw.o.dt
|
||||
#-MT
|
||||
#/home/mkl/pengutronix/ptxdist/build/OSELAS.Toolchain-trunk-headers/build-target/glibc-2.5-build/math/setfpucw.o
|
||||
# ../ports/sysdeps/arm/eabi/setfpucw.c:26:26: error: asm/procinfo.h: No such file or directory
|
||||
# ../ports/sysdeps/arm/eabi/setfpucw.c: In function '__setfpucw':
|
||||
# ../ports/sysdeps/arm/eabi/setfpucw.c:31: error: 'HWCAP_VFP' undeclared (first use in this function)
|
||||
# ../ports/sysdeps/arm/eabi/setfpucw.c:31: error: (Each undeclared identifier is reported only once
|
||||
# ../ports/sysdeps/arm/eabi/setfpucw.c:31: error: for each function it appears in.)
|
||||
#
|
||||
# Description:
|
||||
#
|
||||
# http://sourceware.org/ml/libc-ports/2006-10/msg00040.html
|
||||
#
|
||||
# State:
|
||||
#
|
||||
# added to glibc-ports on 10/31/2006 06:20 PM
|
||||
#
|
||||
Date: Tue, 24 Oct 2006 19:25:12 +0000 (UTC)
|
||||
From: "Joseph S. Myers" <joseph@codesourcery.com>
|
||||
To: libc-ports@sourceware.org
|
||||
Subject: Avoid using asm/procinfo.h
|
||||
|
||||
I previously noted
|
||||
<http://sourceware.org/ml/libc-ports/2006-08/msg00023.html> that the
|
||||
use of <asm/procinfo.h>, a Linux-specific kernel header, in
|
||||
sysdeps/arm/eabi, is an abstraction violation, and that in principle
|
||||
all the files in sysdeps/arm/eabi should use sysdep.h not
|
||||
asm/procinfo.h for HWCAP_VFP.
|
||||
|
||||
The ARM kernel maintainers have now declared that <asm/procinfo.h>
|
||||
should not be used outside the kernel at all (and in particular that
|
||||
headers_install is correct in not exporting it), and that these
|
||||
definitions will move to a different kernel header. This gives a
|
||||
concrete reason for making the change to use glibc's internal
|
||||
definitions, which this patch does, thereby allowing glibc to build
|
||||
with the exported headers.
|
||||
|
||||
2006-10-24 Joseph S. Myers <joseph@codesourcery.com>
|
||||
|
||||
* sysdeps/arm/eabi/fclrexcpt.c: Include <sysdep.h> instead of
|
||||
<asm/procinfo.h>. Use HWCAP_ARM_VFP instead of HWCAP_VFP.
|
||||
* sysdeps/arm/eabi/fedisblxcpt.c: Likewise.
|
||||
* sysdeps/arm/eabi/feenablxcpt.c: Likewise.
|
||||
* sysdeps/arm/eabi/fegetenv.c: Likewise.
|
||||
* sysdeps/arm/eabi/fegetexcept.c: Likewise.
|
||||
* sysdeps/arm/eabi/fegetround.c: Likewise.
|
||||
* sysdeps/arm/eabi/feholdexcpt.c: Likewise.
|
||||
* sysdeps/arm/eabi/fesetenv.c: Likewise.
|
||||
* sysdeps/arm/eabi/fesetround.c: Likewise.
|
||||
* sysdeps/arm/eabi/fraiseexcpt.c: Likewise.
|
||||
* sysdeps/arm/eabi/fsetexcptflg.c: Likewise.
|
||||
* sysdeps/arm/eabi/ftestexcept.c: Likewise.
|
||||
* sysdeps/arm/eabi/setfpucw.c: Likewise.
|
||||
|
||||
Index: glibc-ports-2.5/sysdeps/arm/eabi/fclrexcpt.c
|
||||
===================================================================
|
||||
--- glibc-ports-2.5.orig/sysdeps/arm/eabi/fclrexcpt.c
|
||||
+++ glibc-ports-2.5/sysdeps/arm/eabi/fclrexcpt.c
|
||||
@@ -23,12 +23,12 @@
|
||||
#include <unistd.h>
|
||||
#include <ldsodefs.h>
|
||||
#include <dl-procinfo.h>
|
||||
-#include <asm/procinfo.h>
|
||||
+#include <sysdep.h>
|
||||
|
||||
int
|
||||
__feclearexcept (int excepts)
|
||||
{
|
||||
- if (GLRO (dl_hwcap) & HWCAP_VFP)
|
||||
+ if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
|
||||
{
|
||||
unsigned long int temp;
|
||||
|
||||
Index: glibc-ports-2.5/sysdeps/arm/eabi/fedisblxcpt.c
|
||||
===================================================================
|
||||
--- glibc-ports-2.5.orig/sysdeps/arm/eabi/fedisblxcpt.c
|
||||
+++ glibc-ports-2.5/sysdeps/arm/eabi/fedisblxcpt.c
|
||||
@@ -24,12 +24,12 @@
|
||||
#include <unistd.h>
|
||||
#include <ldsodefs.h>
|
||||
#include <dl-procinfo.h>
|
||||
-#include <asm/procinfo.h>
|
||||
+#include <sysdep.h>
|
||||
|
||||
int
|
||||
fedisableexcept (int excepts)
|
||||
{
|
||||
- if (GLRO (dl_hwcap) & HWCAP_VFP)
|
||||
+ if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
|
||||
{
|
||||
unsigned long int new_exc, old_exc;
|
||||
|
||||
Index: glibc-ports-2.5/sysdeps/arm/eabi/feenablxcpt.c
|
||||
===================================================================
|
||||
--- glibc-ports-2.5.orig/sysdeps/arm/eabi/feenablxcpt.c
|
||||
+++ glibc-ports-2.5/sysdeps/arm/eabi/feenablxcpt.c
|
||||
@@ -24,12 +24,12 @@
|
||||
#include <unistd.h>
|
||||
#include <ldsodefs.h>
|
||||
#include <dl-procinfo.h>
|
||||
-#include <asm/procinfo.h>
|
||||
+#include <sysdep.h>
|
||||
|
||||
int
|
||||
feenableexcept (int excepts)
|
||||
{
|
||||
- if (GLRO (dl_hwcap) & HWCAP_VFP)
|
||||
+ if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
|
||||
{
|
||||
unsigned long int new_exc, old_exc;
|
||||
|
||||
Index: glibc-ports-2.5/sysdeps/arm/eabi/fegetenv.c
|
||||
===================================================================
|
||||
--- glibc-ports-2.5.orig/sysdeps/arm/eabi/fegetenv.c
|
||||
+++ glibc-ports-2.5/sysdeps/arm/eabi/fegetenv.c
|
||||
@@ -23,12 +23,12 @@
|
||||
#include <unistd.h>
|
||||
#include <ldsodefs.h>
|
||||
#include <dl-procinfo.h>
|
||||
-#include <asm/procinfo.h>
|
||||
+#include <sysdep.h>
|
||||
|
||||
int
|
||||
__fegetenv (fenv_t *envp)
|
||||
{
|
||||
- if (GLRO (dl_hwcap) & HWCAP_VFP)
|
||||
+ if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
|
||||
{
|
||||
unsigned long int temp;
|
||||
_FPU_GETCW (temp);
|
||||
Index: glibc-ports-2.5/sysdeps/arm/eabi/fegetexcept.c
|
||||
===================================================================
|
||||
--- glibc-ports-2.5.orig/sysdeps/arm/eabi/fegetexcept.c
|
||||
+++ glibc-ports-2.5/sysdeps/arm/eabi/fegetexcept.c
|
||||
@@ -24,12 +24,12 @@
|
||||
#include <unistd.h>
|
||||
#include <ldsodefs.h>
|
||||
#include <dl-procinfo.h>
|
||||
-#include <asm/procinfo.h>
|
||||
+#include <sysdep.h>
|
||||
|
||||
int
|
||||
fegetexcept (void)
|
||||
{
|
||||
- if (GLRO (dl_hwcap) & HWCAP_VFP)
|
||||
+ if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
|
||||
{
|
||||
unsigned long temp;
|
||||
|
||||
Index: glibc-ports-2.5/sysdeps/arm/eabi/fegetround.c
|
||||
===================================================================
|
||||
--- glibc-ports-2.5.orig/sysdeps/arm/eabi/fegetround.c
|
||||
+++ glibc-ports-2.5/sysdeps/arm/eabi/fegetround.c
|
||||
@@ -23,12 +23,12 @@
|
||||
#include <unistd.h>
|
||||
#include <ldsodefs.h>
|
||||
#include <dl-procinfo.h>
|
||||
-#include <asm/procinfo.h>
|
||||
+#include <sysdep.h>
|
||||
|
||||
int
|
||||
fegetround (void)
|
||||
{
|
||||
- if (GLRO (dl_hwcap) & HWCAP_VFP)
|
||||
+ if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
|
||||
{
|
||||
unsigned int temp;
|
||||
|
||||
Index: glibc-ports-2.5/sysdeps/arm/eabi/feholdexcpt.c
|
||||
===================================================================
|
||||
--- glibc-ports-2.5.orig/sysdeps/arm/eabi/feholdexcpt.c
|
||||
+++ glibc-ports-2.5/sysdeps/arm/eabi/feholdexcpt.c
|
||||
@@ -23,12 +23,12 @@
|
||||
#include <unistd.h>
|
||||
#include <ldsodefs.h>
|
||||
#include <dl-procinfo.h>
|
||||
-#include <asm/procinfo.h>
|
||||
+#include <sysdep.h>
|
||||
|
||||
int
|
||||
feholdexcept (fenv_t *envp)
|
||||
{
|
||||
- if (GLRO (dl_hwcap) & HWCAP_VFP)
|
||||
+ if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
|
||||
{
|
||||
unsigned long int temp;
|
||||
|
||||
Index: glibc-ports-2.5/sysdeps/arm/eabi/fesetenv.c
|
||||
===================================================================
|
||||
--- glibc-ports-2.5.orig/sysdeps/arm/eabi/fesetenv.c
|
||||
+++ glibc-ports-2.5/sysdeps/arm/eabi/fesetenv.c
|
||||
@@ -23,12 +23,12 @@
|
||||
#include <unistd.h>
|
||||
#include <ldsodefs.h>
|
||||
#include <dl-procinfo.h>
|
||||
-#include <asm/procinfo.h>
|
||||
+#include <sysdep.h>
|
||||
|
||||
int
|
||||
__fesetenv (const fenv_t *envp)
|
||||
{
|
||||
- if (GLRO (dl_hwcap) & HWCAP_VFP)
|
||||
+ if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
|
||||
{
|
||||
unsigned int temp;
|
||||
|
||||
Index: glibc-ports-2.5/sysdeps/arm/eabi/fesetround.c
|
||||
===================================================================
|
||||
--- glibc-ports-2.5.orig/sysdeps/arm/eabi/fesetround.c
|
||||
+++ glibc-ports-2.5/sysdeps/arm/eabi/fesetround.c
|
||||
@@ -23,12 +23,12 @@
|
||||
#include <unistd.h>
|
||||
#include <ldsodefs.h>
|
||||
#include <dl-procinfo.h>
|
||||
-#include <asm/procinfo.h>
|
||||
+#include <sysdep.h>
|
||||
|
||||
int
|
||||
fesetround (int round)
|
||||
{
|
||||
- if (GLRO (dl_hwcap) & HWCAP_VFP)
|
||||
+ if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
|
||||
{
|
||||
fpu_control_t temp;
|
||||
|
||||
Index: glibc-ports-2.5/sysdeps/arm/eabi/fraiseexcpt.c
|
||||
===================================================================
|
||||
--- glibc-ports-2.5.orig/sysdeps/arm/eabi/fraiseexcpt.c
|
||||
+++ glibc-ports-2.5/sysdeps/arm/eabi/fraiseexcpt.c
|
||||
@@ -24,12 +24,12 @@
|
||||
#include <unistd.h>
|
||||
#include <ldsodefs.h>
|
||||
#include <dl-procinfo.h>
|
||||
-#include <asm/procinfo.h>
|
||||
+#include <sysdep.h>
|
||||
|
||||
int
|
||||
feraiseexcept (int excepts)
|
||||
{
|
||||
- if (GLRO (dl_hwcap) & HWCAP_VFP)
|
||||
+ if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
|
||||
{
|
||||
int fpscr;
|
||||
const float fp_zero = 0.0, fp_one = 1.0, fp_max = FLT_MAX,
|
||||
Index: glibc-ports-2.5/sysdeps/arm/eabi/fsetexcptflg.c
|
||||
===================================================================
|
||||
--- glibc-ports-2.5.orig/sysdeps/arm/eabi/fsetexcptflg.c
|
||||
+++ glibc-ports-2.5/sysdeps/arm/eabi/fsetexcptflg.c
|
||||
@@ -24,12 +24,12 @@
|
||||
#include <unistd.h>
|
||||
#include <ldsodefs.h>
|
||||
#include <dl-procinfo.h>
|
||||
-#include <asm/procinfo.h>
|
||||
+#include <sysdep.h>
|
||||
|
||||
int
|
||||
__fesetexceptflag (const fexcept_t *flagp, int excepts)
|
||||
{
|
||||
- if (GLRO (dl_hwcap) & HWCAP_VFP)
|
||||
+ if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
|
||||
{
|
||||
fexcept_t temp;
|
||||
|
||||
Index: glibc-ports-2.5/sysdeps/arm/eabi/ftestexcept.c
|
||||
===================================================================
|
||||
--- glibc-ports-2.5.orig/sysdeps/arm/eabi/ftestexcept.c
|
||||
+++ glibc-ports-2.5/sysdeps/arm/eabi/ftestexcept.c
|
||||
@@ -23,12 +23,12 @@
|
||||
#include <unistd.h>
|
||||
#include <ldsodefs.h>
|
||||
#include <dl-procinfo.h>
|
||||
-#include <asm/procinfo.h>
|
||||
+#include <sysdep.h>
|
||||
|
||||
int
|
||||
fetestexcept (int excepts)
|
||||
{
|
||||
- if (GLRO (dl_hwcap) & HWCAP_VFP)
|
||||
+ if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
|
||||
{
|
||||
fexcept_t temp;
|
||||
|
||||
Index: glibc-ports-2.5/sysdeps/arm/eabi/setfpucw.c
|
||||
===================================================================
|
||||
--- glibc-ports-2.5.orig/sysdeps/arm/eabi/setfpucw.c
|
||||
+++ glibc-ports-2.5/sysdeps/arm/eabi/setfpucw.c
|
||||
@@ -23,12 +23,12 @@
|
||||
#include <unistd.h>
|
||||
#include <ldsodefs.h>
|
||||
#include <dl-procinfo.h>
|
||||
-#include <asm/procinfo.h>
|
||||
+#include <sysdep.h>
|
||||
|
||||
void
|
||||
__setfpucw (fpu_control_t set)
|
||||
{
|
||||
- if (GLRO (dl_hwcap) & HWCAP_VFP)
|
||||
+ if (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
|
||||
{
|
||||
fpu_control_t cw;
|
||||
|
||||
Reference in New Issue
Block a user