summaryrefslogtreecommitdiff
path: root/scripts/build/arch/x86.sh
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2016-04-05 21:47:20 (GMT)
committerAlexey Neyman <stilor@att.net>2016-08-23 18:00:27 (GMT)
commitf2ffdf798ddcd5b471a5055c18215ca2988ddf29 (patch)
treee0ab6994e184c92494f7035ccc7080dc0bf11e01 /scripts/build/arch/x86.sh
parentbf3eceb5d9b27fc65c819abe0b7f3cec704917e7 (diff)
First stab at multilib/uClibc.
Create a separate 'libc_backend_once', install headers into a subdirectory (different sets of headers are installed for 32- and 64-bit architectures), and create a symlink for the dynamic linker location expected by GCC. Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'scripts/build/arch/x86.sh')
-rw-r--r--scripts/build/arch/x86.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/scripts/build/arch/x86.sh b/scripts/build/arch/x86.sh
index 4193278..9cd14a0 100644
--- a/scripts/build/arch/x86.sh
+++ b/scripts/build/arch/x86.sh
@@ -130,3 +130,40 @@ CT_DoArchUClibcConfig() {
;;
esac
}
+
+CT_DoArchUClibcCflags() {
+ local cfg="${1}"
+ local cflags="${2}"
+ local f
+
+ for f in ${cflags}; do
+ case "${f}" in
+ -m64)
+ CT_DoArchUClibcSelectArch "${cfg}" "x86_64"
+ ;;
+ -m32)
+ # Since it's a part of multilib with 64-bit flavor, default
+ # to new architecture (i686).
+ CT_DoArchUClibcSelectArch "${cfg}" "i386"
+ CT_KconfigDisableOption "CONFIG_386" "${cfg}"
+ CT_KconfigDisableOption "CONFIG_486" "${cfg}"
+ CT_KconfigDisableOption "CONFIG_586" "${cfg}"
+ CT_KconfigEnableOption "CONFIG_686" "${cfg}"
+ ;;
+ -mx32)
+ CT_Abort "uClibc does not support x32 ABI"
+ ;;
+ esac
+ done
+}
+
+CT_DoArchUClibcHeaderDir() {
+ local dir_var="${1}"
+ local cflags="${2}"
+
+ # If it is non-default multilib, add a suffix with architecture (reported by gcc)
+ # to the headers installation path.
+ if [ -n "${cflags}" ]; then
+ eval "${dir_var}="$( ${CT_TARGET}-gcc -print-multiarch ${cflags} )
+ fi
+}