فهرست منبع

Merge branch 'master' of git+ssh://openadk.org/git/openadk

Waldemar Brodkorb 10 سال پیش
والد
کامیت
7a77142069

+ 1 - 1
mk/vars.mk

@@ -127,7 +127,7 @@ ifneq ($(ADK_DEBUG),)
 TARGET_CFLAGS+=		-g3 -fno-omit-frame-pointer
 else
 TARGET_CPPFLAGS+=	-DNDEBUG
-TARGET_CFLAGS+=		-fomit-frame-pointer $(TARGET_OPTIMIZATION)
+TARGET_CFLAGS+=		-fomit-frame-pointer $(ADK_TARGET_CFLAGS_OPT)
 # stop generating eh_frame stuff
 TARGET_CFLAGS+=		-fno-unwind-tables -fno-asynchronous-unwind-tables
 # always add debug information

+ 1 - 1
package/adk-test-tools/Makefile

@@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=		adk-test-tools
 PKG_VERSION:=		0.1
-PKG_RELEASE:=		3
+PKG_RELEASE:=		5
 PKG_DESCR:=		helper tools and scripts for adk-test-framework
 PKG_SECTION:=		misc
 PKG_URL:=		http://openadk.org/

+ 4 - 0
package/adk-test-tools/files/test.init

@@ -3,6 +3,10 @@
 #INIT 90
 [[ $1 = autostart ]] || exit 0
 echo "Starting test script ..."
+grep shell /proc/cmdline > /dev/null 2&>1
+if [ $? -eq 0 ];then
+	exit 0
+fi
 if [ -x /run.sh ];then
 	/run.sh
 	quit

+ 1 - 1
package/asterisk/Makefile

@@ -105,7 +105,7 @@ TARGET_LDFLAGS+=	-lm -ltinfo -ldl -lpthread
 MAKE_ENV=		ASTCFLAGS="${TARGET_CPPFLAGS} -DHAVE_STRTOQ" \
 			ASTLDFLAGS="${TARGET_LDFLAGS}"
 MAKE_FLAGS+=		DESTDIR="$(WRKINST)" \
-			OPTIMIZE="${TARGET_OPTIMIZATION}" \
+			OPTIMIZE="${TARGET_CFLAGS}" \
 			NOISY_BUILD=1
 ALL_TARGET:=		all install samples
 

+ 1 - 0
rules.mk

@@ -36,6 +36,7 @@ ADK_TARGET_FPU:=			$(strip $(subst ",, $(ADK_TARGET_FPU)))
 ADK_TARGET_ARM_MODE:=			$(strip $(subst ",, $(ADK_TARGET_ARM_MODE)))
 ADK_TARGET_CPU_ARCH:=			$(strip $(subst ",, $(ADK_TARGET_CPU_ARCH)))
 ADK_TARGET_CFLAGS:=			$(strip $(subst ",, $(ADK_TARGET_CFLAGS)))
+ADK_TARGET_CFLAGS_OPT:=			$(strip $(subst ",, $(ADK_TARGET_CFLAGS_OPT)))
 ADK_TARGET_ABI_CFLAGS:=			$(strip $(subst ",, $(ADK_TARGET_ABI_CFLAGS)))
 ADK_TARGET_ABI:=			$(strip $(subst ",, $(ADK_TARGET_ABI)))
 ADK_TARGET_MIPS_ABI:=			$(strip $(subst ",, $(ADK_TARGET_MIPS_ABI)))

+ 206 - 0
scripts/gcc-bisect.sh

@@ -0,0 +1,206 @@
+#!/bin/sh
+rm -rf host_x86_64-linux-gnu target_sparc_glibc
+rm -rf gcc-*
+mkdir host_x86_64-linux-gnu
+mkdir target_sparc_glibc
+
+tar xvf binutils-2.24.tar.bz2
+cd binutils-2.24
+./configure \
+		--prefix=/home/wbx/smoke/host_x86_64-linux-gnu \
+		--target=sparc-openadk-linux-gnu \
+		--with-sysroot=/home/wbx/smoke/target_sparc_glibc \
+		--disable-dependency-tracking \
+		--disable-libtool-lock \
+		--disable-nls \
+		--disable-werror \
+		--disable-plugins \
+		--disable-libssp --disable-multilib
+make -j4 all
+make install
+cd ..
+
+tar xvf gmp-5.1.3.tar.xz
+cd gmp-5.1.3
+cp configfsf.guess config.guess
+PATH="/home/wbx/smoke/host_x86_64-linux-gnu/usr/bin:$PATH" \
+		./configure \
+		--prefix=/home/wbx/smoke/host_x86_64-linux-gnu \
+		--with-pic \
+		--disable-shared \
+		--enable-static
+make -j4 all
+make install
+cd ..
+
+tar xvf mpfr-3.1.2.tar.xz
+cd mpfr-3.1.2
+./configure \
+		--prefix=/home/wbx/smoke/host_x86_64-linux-gnu \
+		--with-gmp-build=/home/wbx/smoke/gmp-5.1.3 \
+		--disable-shared \
+		--enable-static
+make -j4 all
+make install
+cd ..
+
+tar xvf mpc-0.8.2.tar.gz
+cd mpc-0.8.2
+./configure \
+		--prefix=/home/wbx/smoke/host_x86_64-linux-gnu \
+		--with-gmp=/home/wbx/smoke/host_x86_64-linux-gnu \
+		--disable-shared \
+		--enable-static
+make -j4 all
+make install
+make install
+cd ..
+
+tar xvf libelf-0.8.13.tar.gz
+cd libelf-0.8.13
+./configure \
+		--prefix=/home/wbx/smoke/host_x86_64-linux-gnu \
+		--disable-nls \
+		--disable-shared \
+		--enable-static
+make -j4 all
+make install
+cd ..
+
+rm -rf host_x86_64-linux-gnu/sparc-openadk-linux-gnu/{lib,sys-include}
+cd host_x86_64-linux-gnu/sparc-openadk-linux-gnu/
+ln -sf ../../target_sparc_glibc/usr/include sys-include
+ln -sf ../../target_sparc_glibc/lib lib
+cd -
+
+mkdir gcc-minimal
+cd gcc-minimal
+CFLAGS="-O0 -g0" \
+CXXFLAGS="-O0 -g0" \
+PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" \
+../gcc/configure \
+	--prefix=/home/wbx/smoke/host_x86_64-linux-gnu --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=sparc-openadk-linux-gnu --with-gmp=/home/wbx/smoke/host_x86_64-linux-gnu --with-mpfr=/home/wbx/smoke/host_x86_64-linux-gnu --with-libelf=/home/wbx/smoke/host_x86_64-linux-gnu --disable-__cxa_atexit --with-gnu-ld --with-gnu-as --enable-tls --disable-libsanitizer --disable-libitm --disable-libmudflap --disable-libgomp --disable-decimal-float --disable-libstdcxx-pch --disable-ppl-version-check --disable-cloog-version-check --without-system-zlib --without-ppl --without-cloog --without-isl --disable-nls --enable-target-optspace \
+			--enable-languages=c \
+			--disable-multilib \
+			--disable-lto \
+			--disable-libssp \
+			--disable-shared \
+			--without-headers
+PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make -j4 all-gcc
+if [ $? -ne 0 ];then
+	echo failed
+	exit
+fi
+PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make install-gcc
+if [ $? -ne 0 ];then
+	echo failed
+	exit
+fi
+cd ..
+
+cd linux-3.13.6
+make V=1 ARCH=sparc CROSS_COMPILE="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-" CC="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-gcc" HOSTCC="cc" CONFIG_SHELL='/bin/bash' HOSTCFLAGS='-O2 -Wall' INSTALL_HDR_PATH=/home/wbx/smoke/target_sparc_glibc/usr headers_install
+cd ..
+
+cd glibc-2.19-header
+libc_cv_forced_unwind=yes \
+libc_cv_cc_with_libunwind=yes \
+libc_cv_c_cleanup=yes \
+libc_cv_gnu99_inline=yes \
+libc_cv_initfini_array=yes \
+PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" ../glibc-2.19/configure \
+	--prefix=/home/wbx/smoke/target_sparc_glibc/usr \
+	--with-sysroot=/home/wbx/smoke/target_sparc_glibc \
+	--build=x86_64-linux-gnu --host=sparc-openadk-linux-gnu --with-headers=/home/wbx/smoke/target_sparc_glibc/usr/include --disable-sanity-checks --disable-nls --without-cvs --disable-profile --disable-debug --without-gd --disable-nscd --with-__thread --with-tls --enable-kernel="2.6.32" --enable-add-ons
+PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make cross-compiling=yes PARALLELMFLAGS="-j1" install-headers
+if [ $? -ne 0 ];then
+	echo failed
+	exit
+fi
+cd ..
+touch target_sparc_glibc/usr/include/gnu/stubs.h
+
+mkdir gcc-initial
+cd gcc-initial
+CFLAGS="-O0 -g0" \
+CXXFLAGS="-O0 -g0" \
+PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" ../gcc/configure \
+	--prefix=/home/wbx/smoke/host_x86_64-linux-gnu --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=sparc-openadk-linux-gnu --with-gmp=/home/wbx/smoke/host_x86_64-linux-gnu --with-mpfr=/home/wbx/smoke/host_x86_64-linux-gnu --with-libelf=/home/wbx/smoke/host_x86_64-linux-gnu --disable-__cxa_atexit --with-gnu-ld --with-gnu-as --enable-tls --disable-libsanitizer --disable-libitm --disable-libmudflap --disable-libgomp --disable-decimal-float --disable-libstdcxx-pch --disable-ppl-version-check --disable-cloog-version-check --without-system-zlib --without-ppl --without-cloog --without-isl --disable-nls --enable-target-optspace \
+			 --disable-biarch --disable-multilib --enable-libssp --enable-lto \
+			--enable-languages=c \
+			--disable-shared \
+			--disable-threads \
+			--with-sysroot=/home/wbx/smoke/target_sparc_glibc
+PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make all-gcc
+if [ $? -ne 0 ];then
+	echo failed
+	exit
+fi
+PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make all-target-libgcc
+if [ $? -ne 0 ];then
+	echo failed
+	exit
+fi
+PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make install-gcc install-target-libgcc
+if [ $? -ne 0 ];then
+	echo failed
+	exit
+fi
+cd ..
+
+cd glibc-2.19-final
+PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" SHELL='/bin/bash' BUILD_CC=cc CFLAGS="-mcpu=v8 -fwrapv -fno-ident -fomit-frame-pointer -O2 -pipe -fno-unwind-tables -fno-asynchronous-unwind-tables -g3" CC="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-gcc" CXX="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-g++" AR="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-ar" RANLIB="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-ranlib" libc_cv_forced_unwind=yes libc_cv_cc_with_libunwind=yes libc_cv_c_cleanup=yes libc_cv_gnu99_inline=yes libc_cv_initfini_array=yes  \
+../glibc-2.19/configure \
+	--prefix=/usr \
+	--enable-shared \
+	--enable-stackguard-randomization \
+	--build=x86_64-linux-gnu --host=sparc-openadk-linux-gnu --with-headers=/home/wbx/smoke/target_sparc_glibc/usr/include --disable-sanity-checks --disable-nls --without-cvs --disable-profile --disable-debug --without-gd --disable-nscd --with-__thread --with-tls --enable-kernel="2.6.32" --enable-add-ons 
+PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make all
+PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make install_root=/home/wbx/smoke/target_sparc_glibc install
+if [ $? -ne 0 ];then
+	echo failed
+	exit
+fi
+cd ..
+
+mkdir gcc-final
+cd gcc-final
+../gcc/configure \
+	--prefix=/home/wbx/smoke/host_x86_64-linux-gnu --with-bugurl="http://www.openadk.org/" --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=sparc-openadk-linux-gnu --with-gmp=/home/wbx/smoke/host_x86_64-linux-gnu --with-mpfr=/home/wbx/smoke/host_x86_64-linux-gnu --with-libelf=/home/wbx/smoke/host_x86_64-linux-gnu --disable-__cxa_atexit --with-gnu-ld --with-gnu-as --enable-tls --disable-libsanitizer --disable-libitm --disable-libmudflap --disable-libgomp --disable-decimal-float --disable-libstdcxx-pch --disable-ppl-version-check --disable-cloog-version-check --without-system-zlib --without-ppl --without-cloog --without-isl --disable-nls --enable-target-optspace \
+			 --disable-biarch --disable-multilib --enable-libssp --enable-lto \
+			--enable-languages=c,c++ \
+			--with-build-sysroot='${prefix}/../target_sparc_glibc' \
+			--with-sysroot='${prefix}/../target_sparc_glibc' \
+			--enable-shared
+make -j4 all
+if [ $? -ne 0 ];then
+	echo failed
+	exit
+fi
+make install
+if [ $? -ne 0 ];then
+	echo failed
+	exit
+fi
+cd ..
+
+cd linux-3.13.6/
+cat > mini.config <<EOF
+CONFIG_SPARC=y
+CONFIG_SPARC32=y
+CONFIG_SBUS=y
+CONFIG_SBUSCHAR=y
+CONFIG_PCI=y
+CONFIG_PCI_SYSCALL=y
+CONFIG_PCIC_PCI=y
+CONFIG_OF=y
+CONFIG_NET_VENDOR_AMD=y
+CONFIG_SUNLANCE=y
+CONFIG_SERIAL_CONSOLE=y
+CONFIG_SERIAL_SUNCORE=y
+CONFIG_SERIAL_SUNZILOG=y
+CONFIG_SERIAL_SUNZILOG_CONSOLE=y
+EOF
+
+PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make V=1 ARCH=sparc CROSS_COMPILE="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-" CC="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-gcc" HOSTCC="cc" CONFIG_SHELL='/bin/bash' HOSTCFLAGS='-O2 -Wall' KCONFIG_ALLCONFIG=mini.config allnoconfig 
+PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make V=1 ARCH=sparc CROSS_COMPILE="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-" CC="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-gcc" HOSTCC="cc" CONFIG_SHELL='/bin/bash' HOSTCFLAGS='-O2 -Wall' -j4 zImage

+ 0 - 1
target/arm/target.mk

@@ -1,5 +1,4 @@
 include $(TOPDIR)/mk/kernel-ver.mk
 ARCH:=			arm
 CPU_ARCH:=		$(ADK_TARGET_CPU_ARCH)
-TARGET_OPTIMIZATION:=	-Os -pipe
 TARGET_CFLAGS_ARCH:=    $(ADK_TARGET_CFLAGS)

+ 7 - 0
target/config/Config.in.adk

@@ -19,6 +19,13 @@ config ADK_DL_DIR
 	  Configure the download directory for all source packages.
 	  Use an absolute path.
 
+config ADK_TARGET_CFLAGS_OPT
+	string "optimization flags for compiler"
+	default "-Os -pipe"
+	help
+	  Compilation is only verfied with optimization for code size (Os).
+	  Other stuff (O2) might break. Will not be used when ADK_DEBUG is on.
+
 config ADK_DEBUG
 	bool "Compile applications with debug support by default"
 	default n

+ 1 - 0
target/config/Config.in.runtime

@@ -39,6 +39,7 @@ config ADK_RUNTIME_TIMEZONE
 choice
 prompt "Start getty or shell after bootup"
 default ADK_RUNTIME_GETTY
+default ADK_RUNTIME_SHELL if ADK_PKG_TEST
 
 config ADK_RUNTIME_GETTY
 	boolean "start a getty after bootup"

+ 1 - 1
target/linux/config/Config.in.debug

@@ -34,7 +34,7 @@ config ADK_KERNEL_PRINTK
 	boolean
 	select ADK_KERNEL_EARLY_PRINTK
 	default y
-	#depends on !ADK_PKG_TEST
+	depends on !ADK_PKG_TEST
 	help
 	  Disable printk to save space and quieten bootup.
 

+ 0 - 1
target/m68k/target.mk

@@ -1,5 +1,4 @@
 include $(TOPDIR)/mk/kernel-ver.mk
 ARCH:=			m68k
 CPU_ARCH:=		$(ADK_TARGET_CPU_ARCH)
-TARGET_OPTIMIZATION:=	-Os -pipe
 TARGET_CFLAGS_ARCH:=    $(ADK_TARGET_CFLAGS)

+ 0 - 1
target/microblaze/target.mk

@@ -1,5 +1,4 @@
 include $(TOPDIR)/mk/kernel-ver.mk
 ARCH:=			microblaze
 CPU_ARCH:=		$(ADK_TARGET_CPU_ARCH)
-TARGET_OPTIMIZATION:=	-Os -pipe
 TARGET_CFLAGS_ARCH:=    $(ADK_TARGET_CFLAGS)

+ 0 - 1
target/mips/target.mk

@@ -1,5 +1,4 @@
 include $(TOPDIR)/mk/kernel-ver.mk
 ARCH:=			mips
 CPU_ARCH:=		$(ADK_TARGET_CPU_ARCH)
-TARGET_OPTIMIZATION:=	-Os -pipe
 TARGET_CFLAGS_ARCH:=    $(ADK_TARGET_CFLAGS)

+ 0 - 1
target/ppc/target.mk

@@ -1,5 +1,4 @@
 include $(TOPDIR)/mk/kernel-ver.mk
 ARCH:=			powerpc
 CPU_ARCH:=		ppc
-TARGET_OPTIMIZATION:=	-Os -pipe
 TARGET_CFLAGS_ARCH:=	$(ADK_TARGET_CFLAGS) -Wl,--secure-plt

+ 1 - 0
target/ppc64/sys-available/qemu-ppc64

@@ -3,6 +3,7 @@ config ADK_TARGET_SYSTEM_QEMU_PPC64
 	select ADK_ppc64
 	select ADK_qemu_ppc64
 	select ADK_CPU_PPC64
+	select ADK_LINUX_64
 	select ADK_HARDWARE_QEMU
 	help
 	 Support for Qemu Emulator (PPC64).

+ 1 - 0
target/ppc64/sys-available/toolchain-ppc64

@@ -3,6 +3,7 @@ config ADK_TARGET_SYSTEM_TOOLCHAIN_PPC64
 	select ADK_ppc64
 	select ADK_toolchain_ppc64
 	select ADK_CPU_PPC64
+	select ADK_LINUX_64
 	select ADK_TOOLCHAIN
 	select ADK_TARGET_PACKAGE_TGZ
 	help

+ 0 - 1
target/ppc64/target.mk

@@ -1,5 +1,4 @@
 include $(TOPDIR)/mk/kernel-ver.mk
 ARCH:=			powerpc
 CPU_ARCH:=		ppc64
-TARGET_OPTIMIZATION:=	-Os -pipe
 TARGET_CFLAGS_ARCH:=	$(ADK_TARGET_CFLAGS)

+ 0 - 1
target/sh/target.mk

@@ -1,5 +1,4 @@
 include $(TOPDIR)/mk/kernel-ver.mk
 ARCH:=			sh
 CPU_ARCH:=		$(ADK_TARGET_CPU_ARCH)
-TARGET_OPTIMIZATION:=	-Os -pipe
 TARGET_CFLAGS_ARCH:=    $(ADK_TARGET_CFLAGS)

+ 0 - 1
target/sparc/target.mk

@@ -1,5 +1,4 @@
 include $(TOPDIR)/mk/kernel-ver.mk
 ARCH:=			sparc
 CPU_ARCH:=		sparc
-TARGET_OPTIMIZATION:=	-Os -pipe
 TARGET_CFLAGS_ARCH:=    $(ADK_TARGET_CFLAGS)

+ 1 - 0
target/sparc64/sys-available/qemu-sparc64

@@ -2,6 +2,7 @@ config ADK_TARGET_SYSTEM_QEMU_SPARC64
 	bool "Qemu Emulator"
 	select ADK_sparc64
 	select ADK_qemu_sparc64
+	select ADK_LINUX_64
 	select ADK_CPU_SPARC_V9
 	select ADK_HARDWARE_QEMU
 	select ADK_TARGET_KERNEL_ZIMAGE

+ 1 - 0
target/sparc64/sys-available/toolchain-sparc64

@@ -3,6 +3,7 @@ config ADK_TARGET_SYSTEM_TOOLCHAIN_SPARC64
 	select ADK_sparc64
 	select ADK_toolchain_sparc64
 	select ADK_CPU_SPARC_V9
+	select ADK_LINUX_64
 	select ADK_TOOLCHAIN
 	select ADK_TARGET_PACKAGE_TGZ
 	help

+ 0 - 1
target/sparc64/target.mk

@@ -1,5 +1,4 @@
 include $(TOPDIR)/mk/kernel-ver.mk
 ARCH:=			sparc
 CPU_ARCH:=		sparc64
-TARGET_OPTIMIZATION:=	-Os -pipe
 TARGET_CFLAGS_ARCH:=    $(ADK_TARGET_CFLAGS)

+ 0 - 1
target/x86/target.mk

@@ -1,5 +1,4 @@
 include $(TOPDIR)/mk/kernel-ver.mk
 ARCH:=			x86
 CPU_ARCH:=		$(strip $(subst ",, $(ADK_TARGET_CPU_ARCH)))
-TARGET_OPTIMIZATION:=	-Os -pipe
 TARGET_CFLAGS_ARCH:=	$(ADK_TARGET_CFLAGS)

+ 0 - 1
target/x86_64/target.mk

@@ -1,5 +1,4 @@
 include $(TOPDIR)/mk/kernel-ver.mk
 ARCH:=			x86
 CPU_ARCH:=		x86_64
-TARGET_OPTIMIZATION:=	-Os -pipe
 TARGET_CFLAGS_ARCH:=    $(ADK_TARGET_CFLAGS)

+ 1 - 1
toolchain/gcc/Makefile

@@ -28,7 +28,7 @@ GCC_CONFOPTS:=		--prefix=$(TOOLCHAIN_DIR)/usr \
 			--disable-libstdcxx-pch \
 			--disable-ppl-version-check \
 			--disable-cloog-version-check \
-			--without-system-zlib \
+			--with-system-zlib \
 			--without-ppl \
 			--without-cloog \
 			--without-isl \

+ 9 - 6
toolchain/musl/Makefile

@@ -12,6 +12,7 @@ endif
 
 $(WRKBUILD)/.headers:
 	(cd $(WRKBUILD); CC='$(TARGET_CC)' CROSS_COMPILE='$(TARGET_CROSS)' \
+		CFLAGS='$(TARGET_CFLAGS)' \
 		./configure --prefix=/usr \
 		--target=$(GNU_TARGET_NAME) \
 		--disable-gcc-wrapper \
@@ -22,29 +23,31 @@ $(WRKBUILD)/.headers:
 
 $(WRKBUILD)/.compiled:
 	# reconfigure musl, otherwise linking with libgcc or libgcc_eh is disabled
-	$(MAKE) CFLAGS='$(TARGET_CFLAGS)' -C $(WRKBUILD) clean
+	$(MAKE) -C $(WRKBUILD) clean
 	(cd $(WRKBUILD); CC='$(TARGET_CC)' CROSS_COMPILE='$(TARGET_CROSS)' \
+		CFLAGS='$(TARGET_CFLAGS)' \
 		./configure --prefix=/usr \
 		--target=$(GNU_TARGET_NAME) \
 		--disable-gcc-wrapper \
 	)
-	$(MAKE) CFLAGS='$(TARGET_CFLAGS)' -C $(WRKBUILD) all
+	$(MAKE) -C $(WRKBUILD) CFLAGS='$(TARGET_CFLAGS)' all
 	touch $@
 
 $(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
-	$(MAKE) -C $(WRKBUILD) DESTDIR=$(STAGING_TARGET_DIR) install
+	$(MAKE) -C $(WRKBUILD) CFLAGS='$(TARGET_CFLAGS)' DESTDIR=$(STAGING_TARGET_DIR) install
 	touch $@
 
 $(WRKBUILD)/.fixup:
 	# reconfigure musl, otherwise linking with libgcc or libgcc_eh is disabled
-	$(MAKE) CFLAGS='$(TARGET_CFLAGS)' -C $(WRKBUILD) clean
+	$(MAKE) -C $(WRKBUILD) clean
 	(cd $(WRKBUILD); CC='$(TARGET_CC)' CROSS_COMPILE='$(TARGET_CROSS)' \
+		CFLAGS='$(TARGET_CFLAGS)' \
 		./configure --prefix=/usr \
 		--target=$(GNU_TARGET_NAME) \
 		--disable-gcc-wrapper \
 	)
-	$(MAKE) CFLAGS='$(TARGET_CFLAGS)' -C $(WRKBUILD) all
-	$(MAKE) -C $(WRKBUILD) DESTDIR=$(STAGING_TARGET_DIR) install
+	$(MAKE) -C $(WRKBUILD) CFLAGS='$(TARGET_CFLAGS)' all
+	$(MAKE) -C $(WRKBUILD) CFLAGS='$(TARGET_CFLAGS)' DESTDIR=$(STAGING_TARGET_DIR) install
 	# cleanup toolchain
 	-find $(STAGING_TARGET_DIR) $(STAGING_HOST_DIR) -name \*.la -delete
 ifeq ($(ADK_TOOLCHAIN),y)