0

Blockquote

Hello, I am trying to compile the latest source of The Powder Toy but my compiler (G++ with scons) is crashing every time it hits a command with --m in it.

Crash log:

scons --lin --release --sse2
scons: Reading SConscript files ...
Checking for C library fftw3f... (cached) yes
Checking for C library bz2... (cached) yes
Checking for C library z... (cached) yes
Checking for C header file bzlib.h... (cached) yes
Checking for C library lua... (cached) no
Checking for C library lua5.1... (cached) yes
scons: done reading SConscript files.
scons: Building targets ...
^[[Ag++ -o build/src/Format.o -c -w -std=c++98 -fkeep-inline-functions -sse2 -O3 -ftree-vectorize -funsafe-math-optimizations -ffast-math -fomit-frame-pointer -funsafe-loop-optimizations -Wunsafe-loop-optimizations -D_GNU_SOURCE=1 -D_REENTRANT -DLUACONSOLE -DGRAVFFT -D_GNU_SOURCE -DUSE_STDINT -D_POSIX_C_SOURCE=200112L -DUSE_SDL -DLIN -DX86 -DX86_SSE2 -I/usr/include/SDL -I/usr/include/lua5.1 -Ibuild/src -Ibuild/data -Ibuild/generated build/src/Format.cpp
g++: error: unrecognized option â-msse2â
scons: *** [build/src/Format.o] Error 1
scons: building terminated because of errors.

Why would this be happening? I've had to delete the -m32 command also to get it to compile.

Brady
  • 10,207
  • 2
  • 20
  • 59
Candunc
  • 98
  • 2
  • 9
  • Can you show the related SCons scripts, please. – Brady Dec 27 '12 at 17:33
  • Also, what version of g++ are you using? If you execute the g++ commands on the command line manually (without SCons) does it still crash? If so, then it has nothing to do with SCons. – Brady Dec 28 '12 at 15:31
  • g++ (Debian 4.6.3-12+rpi1) 4.6.3 Yes, if I use G++ on the comamnd line without scons it crashes on the -m32 command – Candunc Dec 28 '12 at 18:13
  • I added the raspbian tag, lets see if one of the raspberry experts knows something about this problem. It sounds like a TR (error report) needs to be created on the gcc compiler for raspbian. – Brady Dec 29 '12 at 20:09

2 Answers2

1

I strongly suspect that it's because the -sse2 option is telling g++ to generate SSE2, which are SIMD instructions for Intel's x86 architecture. The Raspberry Pi board is a completely different computer architecture (ARM) and does not support SSE2. The ARM equivalent of SSE2 is NEON, but NEON is available for the ARM used in RPi.

I think that for options that g++ doesn't recognize, it tries prefixing with another flag (in this case -m, but I've seen -f before) to see if it's a synonym.

In your case sse2 makes no sense on the Raspberry Pi, and for the above example, is the problem.

TheDuke
  • 750
  • 1
  • 7
  • 22
-1

What is ^[[A ? Do you have unprintable chars in your makefile? Can you echo all parameters one by one to identify which contains these strange characters?

Stepan Yakovenko
  • 8,670
  • 28
  • 113
  • 206
  • He probably hit a key while it was compiling. – ta.speot.is Dec 27 '12 at 05:50
  • There are no makefiles involved here, but instead SCons. This isnt an answer. These sorts of questions should be left as a comment on the original question. – Brady Dec 27 '12 at 17:32
  • Yea, I probably hit an arrow key during the compile accidentally. There isn't any invisible characters in the SConscript, and the only way I've got it to compile is to # out the lines with --m32. This is the do a proper compile and it errors on the line env.Append(CCFLAGS='-msse2') – Candunc Dec 27 '12 at 19:16