Building ftjam with GCC 4.2 using -O2 optimizations fails with a segfault in jam0. This is caused by a violation of strict-aliasing rules which GCC 4.2 assumes are followed with optimization levels of -O2 and above. It can be worked around with -fno-strict-aliasing. All jam implementations appear to be affected, including Perforce jam, ftjam, and Boost.Jam.
gcc -o jam0 -O2 -march=native -pipe -Wstrict-aliasing builtins.c command.c compile.c execnt.c execunix.c execvms.c expand.c filent.c fileos2.c fileunix.c filevms.c glob.c hash.c hdrmacro.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.c newstr.c option.c parse.c pathunix.c pathvms.c regexp.c rules.c scan.c search.c timestamp.c variable.c execunix.c: In function 'execcmd': execunix.c:235: warning: incompatible implicit declaration of built-in function '_exit' hdrmacro.c: In function 'macro_headers': hdrmacro.c:110: warning: dereferencing type-punned pointer will break strict-aliasing rules hdrmacro.c: In function 'macro_header_get': hdrmacro.c:133: warning: dereferencing type-punned pointer will break strict-aliasing rules newstr.c: In function 'newstr': newstr.c:52: warning: dereferencing type-punned pointer will break strict-aliasing rules rules.c: In function 'bindrule': rules.c:62: warning: dereferencing type-punned pointer will break strict-aliasing rules rules.c: In function 'bindtarget': rules.c:89: warning: dereferencing type-punned pointer will break strict-aliasing rules timestamp.c: In function 'timestamp': timestamp.c:90: warning: dereferencing type-punned pointer will break strict-aliasing rules timestamp.c:116: warning: dereferencing type-punned pointer will break strict-aliasing rules timestamp.c:141: warning: dereferencing type-punned pointer will break strict-aliasing rules timestamp.c: In function 'time_enter': timestamp.c:187: warning: dereferencing type-punned pointer will break strict-aliasing rules variable.c: In function 'var_get': variable.c:235: warning: dereferencing type-punned pointer will break strict-aliasing rules variable.c: In function 'var_enter': variable.c:327: warning: dereferencing type-punned pointer will break strict-aliasing rules chmod a+w jambase.c ./jam0 make: *** [all] Segmentation fault -- dirtyepic salesman said this vacuum's guaranteed gentoo org it could suck an ancient virus from the sea 9B81 6C9F E791 83BB 3AB3 5B2D E625 A073 8379 37E8 (0x837937E8) _______________________________________________ Freetype-devel mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/freetype-devel
