Patchwork -Wa, --divide command not found

login
register
about
Submitter Roger
Date 2011-01-08 23:16:50
Message ID <20110108231649.GB4575@localhost2.local>
Download mbox | patch
Permalink /patch/2495/
State Rejected
Headers show

Comments

Roger - 2011-01-08 23:16:50
I get the following after typing "make" within coreboot source folder using
SeaBIOS, "/bin/sh: -Wa,--divide: command not found"

---snip---
Checking out SeaBIOS 0.6.1-stable
Already up-to-date.
M       src/config.h
Already on '0.6.1-stable'
/bin/sh: -Wa,--divide: command not found
  Compiling whole program out/ccode.16.s
---snip---


$ fgrep coreboot/ -r -e "--divide"

./payloads/libpayload/util/xcompile/xcompile:testcc "$CC" "$CFLAGS-Wa,--divide " && CFLAGS="$CFLAGS-Wa,--divide "
./util/abuild/abuild:           # i386-elf target needs --divide, for i386-linux, that's the default
./util/abuild/abuild:                   CC="$CC -Wa,--divide"
./util/xcompile/xcompile:testcc "$CC" "$CFLAGS-Wa,--divide " && CFLAGS="$CFLAGS-Wa,--divide "

(removed .svn folders from above listing)


Ah, looks like there's a missing space char between "$CFLAGS" and "-Wa"
within xcompile:testcc within the above grep!  (First line within the
above grep listing.)

Executing a little further, I'm getting another error with the flags syntax
used within the code.  Looks like somebody substituted commas for spaces on
some of the flags used.

Seems I've corrected some within both xcompile and abuild, but am still
getting "/bin/sh: -fno-stack-protector: command not found" some place.

Attaching an svn diff of what I have so far.
Scott - 2011-01-09 04:35:05
-----Original Message-----
From: coreboot-bounces@coreboot.org [mailto:coreboot-bounces@coreboot.org] On Behalf Of Roger
Sent: Saturday, January 08, 2011 05:17 PM
To: coreboot@coreboot.org
Subject: [coreboot] -Wa, --divide command not found

]I get the following after typing "make" within coreboot source folder using
]SeaBIOS, "/bin/sh: -Wa,--divide: command not found"


To make it work with my mingw build environment, I
had to quote the $(CC) in the seabios makefile:
TESTGCC:=$(shell CC="$(CC)" tools/test-gcc.sh)

I recently read on this list that a fix has been checked in to the seabios source code repository.

Thanks,
Scott


---snip---
Checking out SeaBIOS 0.6.1-stable
Already up-to-date.
M       src/config.h
Already on '0.6.1-stable'
/bin/sh: -Wa,--divide: command not found
  Compiling whole program out/ccode.16.s
---snip---


$ fgrep coreboot/ -r -e "--divide"

./payloads/libpayload/util/xcompile/xcompile:testcc "$CC" "$CFLAGS-Wa,--divide " && CFLAGS="$CFLAGS-Wa,--divide "
./util/abuild/abuild:           # i386-elf target needs --divide, for i386-linux, that's the default
./util/abuild/abuild:                   CC="$CC -Wa,--divide"
./util/xcompile/xcompile:testcc "$CC" "$CFLAGS-Wa,--divide " && CFLAGS="$CFLAGS-Wa,--divide "

(removed .svn folders from above listing)


Ah, looks like there's a missing space char between "$CFLAGS" and "-Wa"
within xcompile:testcc within the above grep!  (First line within the
above grep listing.)

Executing a little further, I'm getting another error with the flags syntax
used within the code.  Looks like somebody substituted commas for spaces on
some of the flags used.

Seems I've corrected some within both xcompile and abuild, but am still
getting "/bin/sh: -fno-stack-protector: command not found" some place.

Attaching an svn diff of what I have so far.

Patch

Index: payloads/libpayload/util/xcompile/xcompile
===================================================================
--- payloads/libpayload/util/xcompile/xcompile	(revision 6247)
+++ payloads/libpayload/util/xcompile/xcompile	(working copy)
@@ -17,7 +17,6 @@ 
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 #
-
 testcc()
 {
 	echo "_start(void) {}" > .$$$$.c
@@ -75,9 +74,9 @@ 
 fi
 
 CC="${GCCPREFIX}gcc"
-testcc "$CC" "$CFLAGS-Wa,--divide " && CFLAGS="$CFLAGS-Wa,--divide "
-testcc "$CC" "$CFLAGS-fno-stack-protector " && CFLAGS="$CFLAGS-fno-stack-protector "
-testcc "$CC" "$CFLAGS-Wl,--build-id=none " && CFLAGS="$CFLAGS-Wl,--build-id=none "
+testcc "$CC" "$CFLAGS -Wa --divide " && CFLAGS="$CFLAGS -Wa --divide "
+testcc "$CC" "$CFLAGS -fno-stack-protector " && CFLAGS="$CFLAGS -fno-stack-protector "
+testcc "$CC" "$CFLAGS -Wl --build-id=none " && CFLAGS="$CFLAGS -Wl --build-id=none "
 
 if which gcc 2>/dev/null >/dev/null; then
 	HOSTCC=gcc
Index: util/xcompile/xcompile
===================================================================
--- util/xcompile/xcompile	(revision 6247)
+++ util/xcompile/xcompile	(working copy)
@@ -75,9 +75,9 @@ 
 fi
 
 CC="${GCCPREFIX}gcc"
-testcc "$CC" "$CFLAGS-Wa,--divide " && CFLAGS="$CFLAGS-Wa,--divide "
-testcc "$CC" "$CFLAGS-fno-stack-protector " && CFLAGS="$CFLAGS-fno-stack-protector "
-testcc "$CC" "$CFLAGS-Wl,--build-id=none " && CFLAGS="$CFLAGS-Wl,--build-id=none "
+testcc "$CC" "$CFLAGS -Wa --divide " && CFLAGS="$CFLAGS -Wa --divide "
+testcc "$CC" "$CFLAGS -fno-stack-protector " && CFLAGS="$CFLAGS -fno-stack-protector "
+testcc "$CC" "$CFLAGS -Wl --build-id=none " && CFLAGS="$CFLAGS -Wl --build-id=none "
 
 if which gcc 2>/dev/null >/dev/null; then
 	HOSTCC=gcc
Index: util/abuild/abuild
===================================================================
--- util/abuild/abuild	(revision 6247)
+++ util/abuild/abuild	(working copy)
@@ -327,7 +327,7 @@ 
 	if which $TARCH-elf-gcc 2>/dev/null >/dev/null; then
 		# i386-elf target needs --divide, for i386-linux, that's the default
 		if [ "$TARCH" = "i386" ]; then
-			CC="$CC -Wa,--divide"
+			CC="$CC -Wa --divide"
 		fi
 		CROSS_COMPILE="$TARCH-elf-"
 		CC=gcc