Project Home
Project Home
Source Code
Source Code
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - assembler problem when compiling the core os using gcc 4.2.1: (4 Items)
   
assembler problem when compiling the core os using gcc 4.2.1  
I just tried building the core OS using 4.2.1 (I set qcc to use 4.2.1 by default). So far I have an assembler error:

make[5]: Entering directory `/qnx-src/trunk/services/system/proc/ppc/be.400'
/usr/qnx632/host/qnx6/x86/usr/bin/qcc -Vgcc_ntoppc -c -O -Wa,-I. -Wa,-I/qnx-src/trunk/services/system/ker/ppc/400 -Wa,-I
/qnx-src/trunk/services/system/ker/ppc/proc -Wa,-I/qnx-src/trunk/services/system/ker/ppc -Wa,-I/qnx-src/trunk/services/
system/ker/. -Wa,-I/qnx-src/trunk/services/system -Wa,-I/qnx-src/trunk/services/system/public -Wa,-I/qnx-src/stage/usr/
include -Wa,-I/usr/qnx632/target/qnx6/usr/include  -Wa,--defsym -Wa,VARIANT_be=1  -Wa,--defsym -Wa,VARIANT_400=1  -Wa,--
defsym -Wa,VARIANT_proc=1 -Wcl,-msdata=sysv -Wcl,-G256 -Wa,-maltivec    -I. -I/qnx-src/trunk/services/system/ker/ppc/400
 -I/qnx-src/trunk/services/system/ker/ppc/proc -I/qnx-src/trunk/services/system/ker/ppc -I/qnx-src/trunk/services/system
/ker/. -I/qnx-src/trunk/services/system -I/qnx-src/trunk/services/system/public -I/qnx-src/stage/usr/include -I/usr/
qnx632/target/qnx6/usr/include    -EB            /qnx-src/trunk/services/system/ker/ppc/kernel.s 
/qnx-src/trunk/services/system/ker/ppc/kernel.s: Assembler messages:
/qnx-src/trunk/services/system/ker/ppc/kernel.s:1280: Error: too many positional arguments
/qnx-src/trunk/services/system/ker/ppc/kernel.s:1431: Error: too many positional arguments
/qnx-src/trunk/services/system/ker/ppc/kernel.s:1851: Error: too many positional arguments
/qnx-src/trunk/services/system/ker/ppc/kernel.s:1931: Error: too many positional arguments
/qnx-src/trunk/services/system/ker/ppc/kernel.s:1936: Error: too many positional arguments
/qnx-src/trunk/services/system/ker/ppc/kernel.s:1941: Error: too many positional arguments
/qnx-src/trunk/services/system/ker/ppc/kernel.s:1946: Error: too many positional arguments
/qnx-src/trunk/services/system/ker/ppc/kernel.s:1951: Error: too many positional arguments
/qnx-src/trunk/services/system/ker/ppc/kernel.s:1976: Error: too many positional arguments
cc: /usr/qnx632/host/qnx6/x86/usr/bin/ntoppc-as-2.17 error 1
make[5]: *** [kernel.o] Error 1
make[5]: Leaving directory `/qnx-src/trunk/services/system/proc/ppc/be.400'
make[4]: *** [install] Error 2
make[4]: Leaving directory `/qnx-src/trunk/services/system/proc/ppc'
make[3]: *** [install] Error 2
make[3]: Leaving directory `/qnx-src/trunk/services/system/proc'
make[2]: *** [install] Error 2
make[2]: Leaving directory `/qnx-src/trunk/services/system'
make[1]: *** [install] Error 2
make[1]: Leaving directory `/qnx-src/trunk/services'
make: *** [install] Error 2

The problem seems to be extra spaces in the assembly file, the parser doesn't like them:

	loadi	%r3,SIGTRAP + (TRAP_TRACE*256) + (FLTBOUNDS*65536)

If you remove the spaces around the + signs, it doesn't complain anymore.

-Ken
Re: assembler problem when compiling the core os using gcc 4.2.1  
Hi Ken,

This is a known issue and we have an outstanding PR for this problem against the kernel source. There are also some 
changes required to libc with the new assembler. Attached is a draft patch. 

Please let us know if you have any problems or questions.

Regards,

Ryan Mansfield
 
Attachment: Text ppc-proc-as.patch 14.23 KB
Re: assembler problem when compiling the core os using gcc 4.2.1  
Here is the draft patch for lib/c
Attachment: Text libc-as.patch 3.85 KB
Re: assembler problem when compiling the core os using gcc 4.2.1  
I just noticed that the patch contains a change that requires a new qcc.

Index: common.mk
===================================================================
--- common.mk	(revision 139960)
+++ common.mk	(working copy)
@@ -117,7 +117,7 @@
 				$(if $(filter $(foreach f, $(ADDON_MODULE_DIRS), $(PROJECT_ROOT)/$(f)/%), $<),-DCOMPILING_MODULE)
 CCFLAGS += -D_BASE_FILE_=$(basename $@) 
 
-LDF_gcc_qcc = -M
+LDF_gcc_qcc = -Map
 LDFLAGS += timestamp.o $(LDF_$(COMPILER_TYPE)_$(COMPILER_DRIVER)) \
 				$(LDFLAGS_$(SRC_SECTION)_$(CPU))	\
 				$(LDFLAGS_$(basename $@)_$(CPU))



Please revert the common.mk to use -M for now.

Regards,

Ryan Mansfield