View Single Post
Old 09-26-2012, 05:00 PM   #702
Kai771
Just a Noob
Kai771 can program the VCR without an owner's manual.Kai771 can program the VCR without an owner's manual.Kai771 can program the VCR without an owner's manual.Kai771 can program the VCR without an owner's manual.Kai771 can program the VCR without an owner's manual.Kai771 can program the VCR without an owner's manual.Kai771 can program the VCR without an owner's manual.Kai771 can program the VCR without an owner's manual.Kai771 can program the VCR without an owner's manual.Kai771 can program the VCR without an owner's manual.Kai771 can program the VCR without an owner's manual.
 
Kai771's Avatar
 
Posts: 145
Karma: 162610
Join Date: Aug 2011
Device: Kindle 3
Well, I didn't really want to, but my curiosity got the better of me, and I tried gcc -Q -v hello.c approach. for CS/MG 2012.3 i got this (unimportant parts omitted):
Code:
gcc version 4.6.3 (Sourcery CodeBench Lite 2012.03-57) 
COLLECT_GCC_OPTIONS='-Q' '-v' '-march=armv5te' '-mtls-dialect=gnu' '-funwind-tables' '-D' '__CS_SOURCERYGXX_MAJ__=2012' '-D' 

options passed:  -v
 -iprefix /opt/arm-2012.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.3/
 -isysroot /opt/arm-2012.03/bin/../arm-none-linux-gnueabi/libc
 -D __CS_SOURCERYGXX_MAJ__=2012 -D __CS_SOURCERYGXX_MIN__=3
 -D __CS_SOURCERYGXX_REV__=57 hello.c -march=armv5te -mtls-dialect=gnu
 -funwind-tables
options enabled:  -fauto-inc-dec -fbranch-count-reg -fcommon
 -fdelete-null-pointer-checks -fdwarf2-cfi-asm -fearly-inlining
 -feliminate-unused-debug-types -ffunction-cse -fgcse-lm -fident
 -finline-functions-called-once -fira-share-save-slots
 -fira-share-spill-slots -fivopts -fkeep-static-consts -fleading-underscore
 -fmath-errno -fmerge-debug-strings -fmove-loop-invariants -fpeephole
 -fprefetch-loop-arrays -freg-struct-return -fsched-critical-path-heuristic
 -fsched-dep-count-heuristic -fsched-group-heuristic -fsched-interblock
 -fsched-last-insn-heuristic -fsched-rank-heuristic -fsched-spec
 -fsched-spec-insn-heuristic -fsched-stalled-insns-dep -fshow-column
 -fsigned-zeros -fsplit-ivs-in-unroller -fstrict-volatile-bitfields
 -ftrapping-math -ftree-cselim -ftree-forwprop -ftree-loop-if-convert
 -ftree-loop-im -ftree-loop-ivcanon -ftree-loop-optimize
 -ftree-parallelize-loops= -ftree-phiprop -ftree-pta -ftree-reassoc
 -ftree-scev-cprop -ftree-slp-vectorize -ftree-vect-loop-version
 -funit-at-a-time -funwind-tables -fvar-tracking -fvar-tracking-assignments
 -fzero-initialized-in-bss -mglibc -mlittle-endian -msched-prolog
And for Ubuntu Linaro I got this:
Code:
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) 
COLLECT_GCC_OPTIONS='-Q' '-v' '-march=armv7-a' '-mfloat-abi=softfp' '-mfpu=vfpv3-d16' '-mthumb'

options passed:  -v -imultilib . -imultiarch arm-linux-gnueabi hello.c
 -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb
 -fstack-protector
options enabled:  -fauto-inc-dec -fbranch-count-reg -fcommon
 -fdelete-null-pointer-checks -fdwarf2-cfi-asm -fearly-inlining
 -feliminate-unused-debug-types -ffunction-cse -fgcse-lm -fident
 -finline-functions-called-once -fira-share-save-slots
 -fira-share-spill-slots -fivopts -fkeep-static-consts -fleading-underscore
 -fmath-errno -fmerge-debug-strings -fmove-loop-invariants -fpeephole
 -fprefetch-loop-arrays -freg-struct-return -fsched-critical-path-heuristic
 -fsched-dep-count-heuristic -fsched-group-heuristic -fsched-interblock
 -fsched-last-insn-heuristic -fsched-rank-heuristic -fsched-spec
 -fsched-spec-insn-heuristic -fsched-stalled-insns-dep -fshow-column
 -fsigned-zeros -fsplit-ivs-in-unroller -fstack-protector
 -fstrict-volatile-bitfields -ftrapping-math -ftree-cselim -ftree-forwprop
 -ftree-loop-if-convert -ftree-loop-im -ftree-loop-ivcanon
 -ftree-loop-optimize -ftree-parallelize-loops= -ftree-phiprop -ftree-pta
 -ftree-reassoc -ftree-scev-cprop -ftree-slp-vectorize
 -ftree-vect-loop-version -funit-at-a-time -fvar-tracking
 -fvar-tracking-assignments -fzero-initialized-in-bss -mglibc
 -mlittle-endian -msched-prolog -mthumb -munaligned-access
 -mvectorize-with-neon-quad
gcc -print-multi-lib in CS gives this:
Code:
$ arm-none-linux-gnueabi-gcc -print-multi-lib
.;
armv4t;@march=armv4t
thumb2;@mthumb@march=armv7
and in Ubuntu Linaro this:
Code:
$ arm-linux-gnueabi-gcc -print-multi-lib
.;
.;@mfloat-abi=softfp
hf;@mfloat-abi=hard
Thinking it might be more productive, I ran gcc -O3 -D_GNU_SOURCE -march=armv6 -Q -v hello.c on CS, and gcc -O3 -fno-stack-protector -U_FORTIFY_SOURCE -march=armv6 -Q -v hello.c on Ubuntu Linaro, and compared "options enabled" sections of these two outputs. I got this:

-fextension-elimination 1 un
-fpromote-loop-indices 1 un
-frename-registers 1
-fschedule-insns 1
-ftree-if-to-switch-conversion 1 un
-ftree-pre-partial-partial 1 un
-funroll-loops 1
-funwind-tables 1
-fweb 1
-mthumb 2
-mvectorize-with-neon-quad 2

Number 1 on the right signifies that that option appeared in CS output, and not in Ubuntu Linaro. Number 2 signifies that it appeared in Ubuntu Linaro, but not in CS.

I first tried setting ARM_CFLAGS:=-march=armv6 -marm -mfloat-abi=softfp -mfpu=vfp. This gave me Illegal Instruction runtime error. I then tried adding all of the options pressent in CS to CFLAGS and CXXFLAGS. It reported unrecognized command line option for those that have "un" on the right. I removed them and tried again, but I again got Segmentation fault. I also tried setting CFLAGS and CXXFLAGS to -O2 -ffast-math -pipe -fomit-frame-pointer -fno-stack-protector -U_FORTIFY_SOURCE, and ARM_CFLAGS="-march=armv6j -mtune=arm1136jf-s -mfpu=vfp". Segmentation fault again.

If anybody has some ideas, I'd be happy to try them. If not, I'll file it under "Ubuntu quirks" for now, and try it again with Ubuntu 12.10 which should come out soon.

Last edited by Kai771; 09-26-2012 at 07:22 PM.
Kai771 is offline   Reply With Quote