From a97a53c61e818185dddf25352eb9b85aa3f2ff43 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Fri, 1 May 2015 21:11:17 +0200 Subject: remove old workaround --- scripts/scan-tools.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'scripts/scan-tools.sh') diff --git a/scripts/scan-tools.sh b/scripts/scan-tools.sh index 1afdb6c64..fc2988d55 100644 --- a/scripts/scan-tools.sh +++ b/scripts/scan-tools.sh @@ -61,7 +61,6 @@ OpenBSD) fi ;; Darwin*) - clang=1 ;; *) # unsupported @@ -79,16 +78,12 @@ else makecmd=$(which gmake 2>/dev/null ) fi -if [ $clang -ne 1 ];then -HCFLAGS=-static-libgcc -fi - cat >Makefile <<'EOF' include ${ADK_TOPDIR}/prereq.mk all: run-test test: test.c - ${HOST_CC} $(HCFLAGS) -o $@ $^ ${LDADD} + ${HOST_CC} -o $@ $^ ${LDADD} run-test: test ./test -- cgit v1.2.3 From c183c3289ae64824a5b58810da27da6487c83ea1 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Fri, 1 May 2015 21:21:59 +0200 Subject: add check for systems without shared libgcc, f.e. OpenADK musl systems --- scripts/scan-tools.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'scripts/scan-tools.sh') diff --git a/scripts/scan-tools.sh b/scripts/scan-tools.sh index fc2988d55..9ec5dcfc5 100644 --- a/scripts/scan-tools.sh +++ b/scripts/scan-tools.sh @@ -5,7 +5,6 @@ shopt -s extglob topdir=$(pwd) opath=$PATH out=0 -clang=0 if [[ $NO_ERROR != @(0|1) ]]; then echo Please do not invoke this script directly! @@ -83,7 +82,7 @@ include ${ADK_TOPDIR}/prereq.mk all: run-test test: test.c - ${HOST_CC} -o $@ $^ ${LDADD} + ${HOST_CC} ${HOST_CFLAGS} -o $@ $^ ${LDADD} run-test: test ./test @@ -97,7 +96,13 @@ cat >test.c <<-'EOF' return (0); } EOF -X=$($makecmd ADK_TOPDIR=$topdir 2>&1) +X=$($makecmd ADK_TOPDIR=$topdir LDADD=-lgcc 2>&1) +if [[ $X != *@(Native compiler works)* ]]; then + echo Cannot compile with shared libgcc use static one. + HOST_CFLAGS=-static-libgcc +fi + +X=$($makecmd ADK_TOPDIR=$topdir HOST_CFLAGS=${HOST_CFLAGS} 2>&1) if [[ $X != *@(Native compiler works)* ]]; then echo "$X" | sed 's/^/| /' echo Cannot compile a simple test programme. @@ -149,7 +154,7 @@ cat >test.c <<-'EOF' } EOF X=$(echo 'Yay! Native compiler works.' | gzip | \ - $makecmd ADK_TOPDIR=$topdir LDADD=-lz 2>&1) + $makecmd ADK_TOPDIR=$topdir LDADD=-lz HOST_CFLAGS=${HOST_CFLAGS} 2>&1) if [[ $X != *@(Native compiler works)* ]]; then echo "$X" | sed 's/^/| /' echo Cannot compile a libz test programm. -- cgit v1.2.3 From 5c5b24f4139bbce45beb31473247d550520035d1 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Fri, 1 May 2015 21:43:44 +0200 Subject: use HOST_CFLAGS for Kconfig and adk tools --- scripts/scan-tools.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts/scan-tools.sh') diff --git a/scripts/scan-tools.sh b/scripts/scan-tools.sh index 9ec5dcfc5..7e27f4014 100644 --- a/scripts/scan-tools.sh +++ b/scripts/scan-tools.sh @@ -100,6 +100,7 @@ X=$($makecmd ADK_TOPDIR=$topdir LDADD=-lgcc 2>&1) if [[ $X != *@(Native compiler works)* ]]; then echo Cannot compile with shared libgcc use static one. HOST_CFLAGS=-static-libgcc + echo "HOST_CFLAGS:=-static-libgcc" >> $topdir/prereq.mk fi X=$($makecmd ADK_TOPDIR=$topdir HOST_CFLAGS=${HOST_CFLAGS} 2>&1) -- cgit v1.2.3 From 7fddef375385fb46a27507472a5f9ca8b1d66fab Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sat, 2 May 2015 08:52:21 +0200 Subject: create HOST_CFLAGS/HOST_CXXFLAGS dynamically for static-libgcc systems --- scripts/scan-tools.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'scripts/scan-tools.sh') diff --git a/scripts/scan-tools.sh b/scripts/scan-tools.sh index 7e27f4014..7c0e89cea 100644 --- a/scripts/scan-tools.sh +++ b/scripts/scan-tools.sh @@ -100,7 +100,11 @@ X=$($makecmd ADK_TOPDIR=$topdir LDADD=-lgcc 2>&1) if [[ $X != *@(Native compiler works)* ]]; then echo Cannot compile with shared libgcc use static one. HOST_CFLAGS=-static-libgcc - echo "HOST_CFLAGS:=-static-libgcc" >> $topdir/prereq.mk + echo "HOST_CFLAGS:=-O0 -g0 -static-libgcc" >> $topdir/prereq.mk + echo "HOST_CXXFLAGS:=-O0 -g0 -static-libgcc" >> $topdir/prereq.mk +else + echo "HOST_CFLAGS:=-O0 -g0" >> $topdir/prereq.mk + echo "HOST_CXXFLAGS:=-O0 -g0" >> $topdir/prereq.mk fi X=$($makecmd ADK_TOPDIR=$topdir HOST_CFLAGS=${HOST_CFLAGS} 2>&1) -- cgit v1.2.3