diff options
Diffstat (limited to 'sysdeps/unix/sysv/linux')
-rw-r--r-- | sysdeps/unix/sysv/linux/Makefile | 41 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/Makefile | 18 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/x86_64/64/Makefile | 2 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/x86_64/Makefile | 19 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/x86_64/x32/Makefile | 3 |
5 files changed, 49 insertions, 34 deletions
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index 70fd137dbc..db05c9e66b 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -40,28 +40,11 @@ sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \ tests += tst-clone -# Generate the list of SYS_* macros for the system calls (__NR_* macros). - -# If there is more than one syscall list for different architecture -# variants, the CPU/Makefile defines syscall-list-variants to be a -# list of names for those variants (e.g. 32bit 64bit), and, for each -# variant, defines syscall-list-$(variant)-options to be compiler -# options to cause <asm/unistd.h> to define the desired list of -# syscalls and syscall-list-$(variant)-condition to be the condition -# for those options to use in a C #if condition. -# syscall-list-includes may be defined to a list of headers to include -# in the generated header, if the default does not suffice. - -ifndef syscall-list-variants -syscall-list-variants := default -syscall-list-default-options := -syscall-list-default-condition := -endif - -ifndef syscall-list-includes -syscall-list-includes := bits/wordsize.h +ifndef abi-list-includes +abi-list-includes := bits/wordsize.h endif +# Generate the list of SYS_* macros for the system calls (__NR_* macros). $(objpfx)bits/syscall%h $(objpfx)bits/syscall%d: ../sysdeps/unix/sysv/linux/sys/syscall.h $(make-target-directory) { \ @@ -71,30 +54,30 @@ $(objpfx)bits/syscall%h $(objpfx)bits/syscall%d: ../sysdeps/unix/sysv/linux/sys/ echo '# error "Never use <bits/syscall.h> directly; include <sys/syscall.h> instead."'; \ echo '#endif'; \ echo ''; \ - $(foreach h,$(syscall-list-includes), echo '#include <$(h)>';) \ + $(foreach h,$(abi-list-includes), echo '#include <$(h)>';) \ echo ''; \ - $(foreach v,$(syscall-list-variants),\ + $(foreach v,$(abi-list-variants),\ $(CC) -E -MD -MP -MF $(@:.h=.d)-t$(v) -MT '$(@:.d=.h) $(@:.h=.d)' \ - -x c $(sysincludes) $< $(syscall-list-$(v)-options) \ + -x c $(sysincludes) $< $(abi-list-$(v)-options) \ -D_LIBC -dM | \ sed -n 's@^#define __NR_\([^ ]*\) .*$$@#define SYS_\1 __NR_\1@p' | \ LC_ALL=C sort > $(@:.d=.h).new$(v); \ - $(if $(syscall-list-$(v)-condition),\ - echo '#if $(syscall-list-$(v)-condition)';) \ + $(if $(abi-list-$(v)-condition),\ + echo '#if $(abi-list-$(v)-condition)';) \ cat $(@:.d=.h).new$(v); \ - $(if $(syscall-list-$(v)-condition),echo '#endif';) \ + $(if $(abi-list-$(v)-condition),echo '#endif';) \ rm -f $(@:.d=.h).new$(v); \ ) \ } > $(@:.d=.h).new mv -f $(@:.d=.h).new $(@:.d=.h) ifneq (,$(objpfx)) sed $(sed-remove-objpfx) \ - $(foreach v,$(syscall-list-variants),$(@:.h=.d)-t$(v)) > $(@:.h=.d)-t3 + $(foreach v,$(abi-list-variants),$(@:.h=.d)-t$(v)) > $(@:.h=.d)-t3 else - cat $(foreach v,$(syscall-list-variants),$(@:.h=.d)-t$(v)) \ + cat $(foreach v,$(abi-list-variants),$(@:.h=.d)-t$(v)) \ > $(@:.h=.d)-t3 endif - rm -f $(foreach v,$(syscall-list-variants),$(@:.h=.d)-t$(v)) + rm -f $(foreach v,$(abi-list-variants),$(@:.h=.d)-t$(v)) mv -f $(@:.h=.d)-t3 $(@:.h=.d) ifndef no_deps diff --git a/sysdeps/unix/sysv/linux/i386/Makefile b/sysdeps/unix/sysv/linux/i386/Makefile index fc5a524ebf..6301affc52 100644 --- a/sysdeps/unix/sysv/linux/i386/Makefile +++ b/sysdeps/unix/sysv/linux/i386/Makefile @@ -1,3 +1,21 @@ +# We don't need any header files. +abi-list-includes := + +# The default ABI is 32. +default-abi := 32 + +abi-list-variants := 32 64 x32 + +abi-list-32-options := -D__i386__ -U__x86_64__ +abi-list-32-condition := !defined __x86_64__ +abi-list-32-ld-soname := ld-linux.so.2 +abi-list-64-options := -U__i386__ -D__x86_64__ -U__ILP32__ -D__LP64__ +abi-list-64-condition := defined __x86_64__ && defined __LP64__ +abi-list-64-ld-soname := ld-linux-x86-64.so.2 +abi-list-x32-options := -U__i386__ -D__x86_64__ -D__ILP32__ -U__LP64__ +abi-list-x32-condition := defined __x86_64__ && defined __ILP32__ +abi-list-x32-ld-soname := ld-linux-x32.so.2 + ifeq ($(subdir),misc) sysdep_routines += ioperm iopl vm86 call_pselect6 call_fallocate sysdep_headers += sys/elf.h sys/perm.h sys/reg.h sys/vm86.h sys/debugreg.h sys/io.h diff --git a/sysdeps/unix/sysv/linux/x86_64/64/Makefile b/sysdeps/unix/sysv/linux/x86_64/64/Makefile new file mode 100644 index 0000000000..a7b6dc5a53 --- /dev/null +++ b/sysdeps/unix/sysv/linux/x86_64/64/Makefile @@ -0,0 +1,2 @@ +# The default ABI is 64. +default-abi := 64 diff --git a/sysdeps/unix/sysv/linux/x86_64/Makefile b/sysdeps/unix/sysv/linux/x86_64/Makefile index 59a6b0a8ba..2b36544e3f 100644 --- a/sysdeps/unix/sysv/linux/x86_64/Makefile +++ b/sysdeps/unix/sysv/linux/x86_64/Makefile @@ -1,8 +1,17 @@ -syscall-list-variants := 32bit 64bit -syscall-list-32bit-options := -D__i386__ -U__x86_64__ -syscall-list-32bit-condition := __WORDSIZE == 32 -syscall-list-64bit-options := -U__i386__ -D__x86_64__ -syscall-list-64bit-condition := __WORDSIZE == 64 +# We don't need any header files. +abi-list-includes := + +abi-list-variants := 32 64 x32 + +abi-list-32-options := -D__i386__ -U__x86_64__ +abi-list-32-condition := !defined __x86_64__ +abi-list-32-ld-soname := ld-linux.so.2 +abi-list-64-options := -U__i386__ -D__x86_64__ -U__ILP32__ -D__LP64__ +abi-list-64-condition := defined __x86_64__ && defined __LP64__ +abi-list-64-ld-soname := ld-linux-x86-64.so.2 +abi-list-x32-options := -U__i386__ -D__x86_64__ -D__ILP32__ -U__LP64__ +abi-list-x32-condition := defined __x86_64__ && defined __ILP32__ +abi-list-x32-ld-soname := ld-linux-x32.so.2 ifeq ($(subdir),misc) sysdep_routines += ioperm iopl diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/Makefile b/sysdeps/unix/sysv/linux/x86_64/x32/Makefile index aa78238a0d..ecbdefb2d3 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/Makefile +++ b/sysdeps/unix/sysv/linux/x86_64/x32/Makefile @@ -1,3 +1,6 @@ +# The default ABI is x32. +default-abi := x32 + ifeq ($(subdir),misc) sysdep_routines += arch_prctl endif |