Hi Luis,

On 05/17/2012 12:58 PM, Luis Alves wrote:
I've built a new toolchain using the latest tools and gcc-4.6.4
(gcc-4.7.0 is giving me compiler internal errors!).
But unfortunately the results are the same (bad assembly code - It
look it is producing 68020 code, since when I use the -m68020 flag,
the resulting assembly code is equal!)

That is bad...


I've downgraded gcc to 4.2.4 (the version I was using before this
toolchain quest) and it works (produces correct assembly code).
I don't know what is the latest working version for the 68000 targets.
Maybe I'll go one by one until I find the broken one...

Ouch, doesn't sound like much fun.


I guess this is related to gcc so I've reported it as a bug it in the
gcc bugzilla (Bug 53386).

Do you have any further suggestion?

The gcc compile options looked good to me. If you have -m68000 set
the you should be getting code that is good for 68000. I guess the
code generation is at least only using the correct set of 68000
instructions.

Choosing a different optimization level may change the instruction/
addressing modes used. But really that would just be a work around.

Otherwise I would suggest sticking with 4.2.4 if that works.

Regards
Greg




On Wed, May 16, 2012 at 9:42 PM, Luis Alves<lja...@gmail.com>  wrote:
Hi Greg,


What are the compiler options supplied to gcc?
(If you make the kernel with V=1 then you get the full command
line trace)


Here is one:

m68k-uclinux-gcc -Wp,-MD,net/sunrpc/.sysctl.o.d á-nostdinc -isystem
/usr/local/lib/gcc/m68k-uclinux/4.5.1/include
-I/root/m68k/20120401/uClinux-dist/linux-3.x/arch/m68k/include
-Iarch/m68k/include/generated -Iinclude á-include
/root/m68k/20120401/uClinux-dist/linux-3.x/include/linux/kconfig.h
-D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs
-fno-strict-aliasing -fno-common -Werror-implicit-function-declaration
-Wno-format-security -fno-delete-null-pointer-checks -O2 -m68000 -pipe
-DUTS_SYSNAME=\"uClinux\" -D__uClinux__ -Wframe-larger-than=1024
-fno-stack-protector -fomit-frame-pointer
-Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow
-fconserve-stack -DCC_HAVE_ASM_GOTO á á-D"KBUILD_STR(s)=#s"
-D"KBUILD_BASENAME=KBUILD_STR(sysctl)"
-D"KBUILD_MODNAME=KBUILD_STR(sunrpc)" -c -o net/sunrpc/sysctl.o
net/sunrpc/sysctl.c

I guess the -m68000 should be enough, but it isn't.

I've compiled the same file with -m68020 and the output assembly is
exactly the same.



When ever i have the time I'll try to build a toolchain (maybe using
gcc 4.7) and check the generated code.
Maybe I also could try the code sourcery one, but there is no
reference for the 'legacy 68k' family on their download page (only
coldfire).


Any m68k targeted compiler should be able to generate code for any
family member with the right command line options. With the bundled
toolchains you may not have the libs generated for your specific
CPU member though.


I just confirmed and there is no support for non-coldfire cpu's in
code sourcery toolchain...

Regards
Greg


------------------------------------------------------------------------

Greg Ungerer á-- áPrincipal Engineer á á á áEMAIL: á á g...@snapgear.com
SnapGear Group, McAfee á á á á á á á á á á áPHONE: á á á +61 7 
3435 2888
8 Gardner Close, á á á á á á á á á á á á á áFAX: á á á á +61 
7 3891 3630
Milton, QLD, 4064, Australia á á á á á á á áWEB: http://www.SnapGear.com



Regards,
Luis Alves





--
------------------------------------------------------------------------
Greg Ungerer  --  Principal Engineer        EMAIL:     g...@snapgear.com
SnapGear Group, McAfee                      PHONE:       +61 7 3435 2888
8 Gardner Close,                            FAX:         +61 7 3891 3630
Milton, QLD, 4064, Australia                WEB: http://www.SnapGear.com
_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to