atabac / python-on-a-chip

Automatically exported from code.google.com/p/python-on-a-chip
Other
0 stars 0 forks source link

Compile and link errors on Ubuntu 10.0 / gcc 4.4.3 #197

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
scons produces:
(lots of compiling...)

gcc -o src/platform/posix/build/main -Wl,-map src/platform/posix/build/main.map 
src/platform/posix/build/main.o src/platform/posix/build/plat.o 
src/platform/posix/build/vm/libpmvm.a 
src/platform/posix/build/pm_generated_objs.o
/usr/bin/ld: unrecognised emulation mode: ap
Supported emulations: elf_i386 i386linux elf_x86_64 elf_l1om
collect2: ld returned 1 exit status

scons check produces:

gcc -o src/tests/system/build/vm/bytearray.o -c -Wall -Wstrict-prototypes 
-Werror -Os -Isrc/vm -Isrc/tests/system/build 
src/tests/system/build/vm/bytearray.c
cc1: warnings being treated as errors
src/tests/system/build/vm/bytearray.c: In function 'bytearray_new':
src/tests/system/build/vm/bytearray.c:49: error: dereferencing pointer 'pb.24' 
does break strict-aliasing rules
src/tests/system/build/vm/bytearray.c:155: note: initialized from here

The following patch fixes both errors.

Original issue reported on code.google.com by bjones460@gmail.com on 29 Mar 2011 at 4:48

Attachments:

GoogleCodeExporter commented 9 years ago
I just tried this patch on Mac OS X 10.6.6 with 
i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5493)

and got this build error

gcc -o src/platform/posix/build/main -Wl,-Map=src/platform/posix/build/main.map 
src/platform/posix/build/main.o src/platform/posix/build/plat.o 
src/platform/posix/build/vm/libpmvm.a 
src/platform/posix/build/pm_generated_objs.o -lm
ld: unknown option: -Map=src/platform/posix/build/main.map
collect2: ld returned 1 exit status
scons: *** [src/platform/posix/build/main] Error 1
scons: building terminated because of errors.

The trouble spot seems to be the difference between "-map" and "-Map".  Let's 
see if we can find an argument acceptable to both compilers.  If we can't I'll 
accept the arguments compatible with gcc 4.4.

Original comment by dwhall...@gmail.com on 9 Apr 2011 at 7:46

GoogleCodeExporter commented 9 years ago
Okay, the fault is that the Mac uses a special linker.  From 
(http://developer.apple.com/tools/gcc_overview.html ):

"""
If you choose to stop the build process after compilation, you can then link by 
invoking the compiler again but allowing it to continue after the compilation 
step. This is the recommended approach. If you invoke the linker manually you 
may spend a lot of time getting the linker flags correct.
"""

Original comment by dwhall...@gmail.com on 9 Apr 2011 at 8:09