Commit dbcf9d60 authored by Riku Voipio's avatar Riku Voipio

support different gcc search patchs

On many crosscompilers ld/as/etc are not installed in same dir as gcc.
They get run in sb2 without argv mangling. Without mangling -rpath-link
gets not passed, and recursive linking fails.

in sb2-config-gcc-toolchain ask gcc where it searches for progs and
use that list for gcc component path map on argvenvp mapping.
Signed-off-by: default avatarRiku Voipio <riku.voipio@iki.fi>
Signed-off-by: default avatarLauri Aarnio <Lauri.Aarnio@iki.fi>
parent 101799b6
......@@ -60,16 +60,28 @@ function register_gcc_component_path(tmp, gccrule)
-- 2. note that cross_gcc_dir is not empty, this file
-- won't be loaded at all if it is (see argvenvp.lua),
-- 3. Wrappers for host-* tools live in /sb2/wrappers.
if gccrule == nil or gccrule.cross_gcc_dir == nil then
tmp.path_prefixes = generic_gcc_tools_path_prefixes
else
local gcc_tools_path_prefixes = {
"/usr/bin/",
gccrule.cross_gcc_dir,
"/sb2/"
}
tmp.path_prefixes = gcc_tools_path_prefixes
local gcc_tools_path_prefixes = {}
-- lua array copy wtf
for j,x in ipairs(generic_gcc_tools_path_prefixes) do
table.insert(gcc_tools_path_prefixes, x)
end
if gccrule == nil then
return
end
if gccrule.cross_gcc_dir ~= nil then
table.insert(gcc_tools_path_prefixes, gccrule.cross_gcc_dir)
end
if gccrule.cross_gcc_progs_path ~= nil then
for path in string.gmatch(gccrule.cross_gcc_progs_path,"[^:]+") do
table.insert(gcc_tools_path_prefixes, path)
end
end
tmp.path_prefixes = gcc_tools_path_prefixes
argvmods[tmp.name] = tmp
end
......
......@@ -94,6 +94,7 @@ gcc_config$gcc_version_id = {
cross_gcc_prefix_list="$SBOX_CROSS_GCC_PREFIX_LIST",
cross_gcc_dir="$SBOX_CROSS_GCC_DIR",
cross_gcc_progs_path="$SBOX_CROSS_GCC_PROGS_PATH",
cross_gcc_version="$SBOX_CROSS_GCC_VERSION",
cross_gcc_shortversion="$SBOX_CROSS_GCC_SHORTVERSION",
......@@ -257,6 +258,9 @@ else
fi
fi
# Path where gcc searches for sub-tools (ld, as, cc1,..)
SBOX_CROSS_GCC_PROGS_PATH=$($GCC -print-search-dirs|grep ^programs:|sed 's/programs: =//')
# default for the cross-gcc prefix list:
# these may be changed by sb2rc.$MAPPING_MODE
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment