Hi Riccardo, > Fred Kiefer wrote: >> If you look at the code in NSData.m you will see that just before the >> failing line there is an #if NEED_WORD_ALIGNMENT clause. The question now is >> why this isn't defined in your case. You will have to report back the >> configure results of your Sparc machine. >> >> Hope this helps, > Yes, it helps! If I manually change that value to 1 and recompile it works. > > I remember having htis topic already with Richard. I think the align test was > tweaked > > Richard, do you rember? > > I upgraded this box to gcc 4.9 in the meanwhile, that's the only change I can > think of. > > See here: > configure:21236: checking short/int needs to be word aligned > configure:21255: gcc -o conftest -g -O2 -I/opt/csw/include > -I/opt/GNUstep/Local/Library/Headers -I/opt/GNUstep/Local/Library/Headers > -I/opt/GNUstep/System/Library/Headers -L/opt/csw/lib -R/opt/csw/lib > -L/opt/csw/lib/ffi -R/opt/csw/lib/ffi -L/opt/GNUstep/Local/Library/Libraries > -L/opt/GNUstep/Local/Library/Libraries > -L/opt/GNUstep/System/Library/Libraries conftest.c -lnsl -lrt -ldl -lpthread > -lz >&5 > In file included from conftest.c:211:0: > ./config/config.align.c: In function 'main': > ./config/config.align.c:13:16: warning: incompatible implicit declaration of > built-in function 'malloc' > char *buf = malloc(30); > ^ > ./config/config.align.c:27:6: warning: assignment from incompatible pointer > type > sp = (short*)(v + 1); > ^ > ./config/config.align.c:28:6: warning: assignment from incompatible pointer > type > sq = (short*)(v + 2); > ^ > configure:21259: $? = 0 > configure:21265: ./conftest > configure:21269: $? = 0 > configure:21294: result: no > > However, if I do "gcc config.align.c" and then run "a.out" > > $ ./a.out > Bus Error (core dumped) > > That's a big fat crash... so? what's wrong with the test? this is somehow a > de-ja-vu.
Does it still segfault if you compile the program with "gcc -O2 config.align.c" and then run "a.out"? It's about a decade ago that I have been using a Sparc machine, but I recall having a similar problem where gcc was generating code with different alignment constraints depending on whether optimization was turned on or not. Though in my case the problem was for floating point numbers. Wolfgang _______________________________________________ Discuss-gnustep mailing list [email protected] https://lists.gnu.org/mailman/listinfo/discuss-gnustep
