path: root/scripts/build/cc/
diff options
authorAlexey Neyman <>2016-03-21 18:18:53 (GMT)
committerAlexey Neyman <>2016-08-23 18:00:27 (GMT)
commit43c303c946c61469181d633cd5620cb92e44c329 (patch)
tree47619ed4dcc052bfc7fbc24d21b577b24d9fbe2e /scripts/build/cc/
parent82072d0cbc238000fd1547551deb198aa8c8d466 (diff)
libc/*.sh: handle combinations of multilib root/dir.
Install startfiles for libc variants into the most specific combination (suffixed sysroot, if applicable + suffixed multi-os dir, if applicable). Install headers once in every suffixed sysroot (although it seems that GCC picks up headers from top-level sysroot, GCC manual claims that sysroot suffix affects headers search path). In uClibc, this requires a better sanitization of the directory: it creates symlinks from {sysroot}/usr/lib/{multi_os_dir} to {sysroot}/lib/{multi_os_dir} and to do so, it counts the number of path components in the libdir. This breaks if one of such components is `..' - symlinks contain an extra `../..' then. Since such sanitization had to be implemented anyway, use it in other places to print more sensible directory names. Also, fix the description of configure --host/--target per musl's configure help message (and its actual code). Signed-off-by: Alexey Neyman <>
Diffstat (limited to 'scripts/build/cc/')
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/build/cc/ b/scripts/build/cc/
index 72e9dd0..db14728 100644
--- a/scripts/build/cc/
+++ b/scripts/build/cc/
@@ -192,11 +192,13 @@ cc_gcc_multilib_housekeeping() {
if [ ${#multilibs[@]} -ne 0 ]; then
CT_DoLog EXTRA "gcc configured with these multilibs (including the default):"
for i in "${multilibs[@]}"; do
- dir="${i%%;*}"
+ dir="lib/${i%%;*}"
flags=${flags//@/ -}
- osdir=$( "${cc}" -print-multi-os-directory ${flags} )
- CT_DoLog EXTRA " '${flags}' --> lib/${dir}/ (gcc) lib/${osdir} (os)"
+ flags=$( echo ${flags} )
+ osdir="lib/"$( "${cc}" -print-multi-os-directory ${flags} )
+ CT_SanitizeVarDir dir osdir
+ CT_DoLog EXTRA " '${flags}' --> ${dir} (gcc) ${osdir} (os)"
for f in ${flags}; do
eval ml_`cc_gcc_classify_opt ${f}`=seen