|
@@ -659,22 +659,27 @@ endif
|
|
|
[dirlibc]
|
|
|
# On linux, try to find where libgcc.a is.
|
|
|
ifeq ($(OS_SOURCE),linux)
|
|
|
+
|
|
|
+# Amd64 to i386?
|
|
|
ifndef GCCLIBDIR
|
|
|
ifeq ($(CPU_TARGET),i386)
|
|
|
ifneq ($(findstring x86_64,$(shell uname -a)),)
|
|
|
-# try debian biarch
|
|
|
ifeq ($(BINUTILSPREFIX),)
|
|
|
GCCLIBDIR:=$(shell dirname `gcc -m32 -print-libgcc-file-name`)
|
|
|
-else
|
|
|
-GCCLIBDIR:=$(shell dirname `$(BINUTILSPREFIX)gcc -print-libgcc-file-name`)
|
|
|
endif
|
|
|
-else
|
|
|
-GCCLIBDIR:=$(shell dirname `$(BINUTILSPREFIX)gcc -print-libgcc-file-name`)
|
|
|
endif
|
|
|
-else
|
|
|
-GCCLIBDIR:=$(shell dirname `$(BINUTILSPREFIX)gcc -print-libgcc-file-name`)
|
|
|
endif
|
|
|
endif
|
|
|
+
|
|
|
+# Try cross gcc
|
|
|
+ifndef GCCLIBDIR
|
|
|
+CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
|
|
|
+ifneq ($(CROSSGCC),)
|
|
|
+GCCLIBDIR:=$(shell dirname `$(CROSSGCC) -print-libgcc-file-name`)
|
|
|
+endif
|
|
|
+endif
|
|
|
+
|
|
|
+# Other libraries from ld.so.conf
|
|
|
ifndef OTHERLIBDIR
|
|
|
OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
|
|
|
endif
|