Skip to contentSkip to conversation

__stack_chk_fail in regexp is not defined

DISCUSSION Glenn Washburn 3 participants 17 messages Nov 8, 2013 – Nov 10, 2013

lore
Share & tools
lore
#0 lore raw

Now, I'm getting this error while building. Bug in the awk script?

cat syminfo.lst | sort | gawk -f ./grub.git/grub-core/genmoddep.awk > moddep.lst || (rm -f moddep.lst; exit 1) __stack_chk_fail in regexp is not defined

#1 lore raw
Quoted 6 lines · Glenn Washburn

Now, I'm getting this error while building. Bug in the awk script?

cat syminfo.lst | sort | gawk -f ./grub.git/grub-core/genmoddep.awk > moddep.lst || (rm -f moddep.lst; exit 1) __stack_chk_fail in regexp is not defined

Can you send me in private relocator.module ?

Quoted 7 lines

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

#2 lore raw
In reply to Glenn Washburn
Quoted 6 lines · Glenn Washburn

Now, I'm getting this error while building. Bug in the awk script?

cat syminfo.lst | sort | gawk -f ./grub.git/grub-core/genmoddep.awk > moddep.lst || (rm -f moddep.lst; exit 1) __stack_chk_fail in regexp is not defined

What compiler do you use and which additional options did you pass to it? It inserted this function call. We need either to provide this function or inhibit compiler from emiting such calls.

Quoted 7 lines

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

#3 lore raw
Quoted 11 lines · On Fri, 08 Nov 2013 19:54:43 +0100 Vladimir 'φ-coder/phcoder' Serbinenko…
Quoted 7 lines · Glenn Washburn

Now, I'm getting this error while building. Bug in the awk script?

cat syminfo.lst | sort | gawk -f ./grub.git/grub-core/genmoddep.awk

Quoted 2 lines

moddep.lst || (rm -f moddep.lst; exit 1) __stack_chk_fail in regexp is

not defined

What compiler do you use and which additional options did you pass to it? It inserted this function call. We need either to provide this function or inhibit compiler from emiting such calls.

I'm using gcc 4.7 on Ubuntu from the ubuntu-toolchain-r/test ppa. I do see a reference to __stack_chk_fail at grub-core/efiemu/runtime/efiemu.c:192. It doesn't look like that file is generated. Perhaps that function was accidentally added to that file?

#4 lore raw

В Fri, 8 Nov 2013 14:42:43 -0600
Glenn Washburn <[email protected]> пишет:

Quoted 15 lines
Quoted 11 lines · On Fri, 08 Nov 2013 19:54:43 +0100 Vladimir 'φ-coder/phcoder' Serbinenko…
Quoted 7 lines · Glenn Washburn

Now, I'm getting this error while building. Bug in the awk script?

cat syminfo.lst | sort | gawk -f ./grub.git/grub-core/genmoddep.awk

Quoted 2 lines

moddep.lst || (rm -f moddep.lst; exit 1) __stack_chk_fail in regexp is

not defined

What compiler do you use and which additional options did you pass to it? It inserted this function call. We need either to provide this function or inhibit compiler from emiting such calls.

Quoted 5 lines

I'm using gcc 4.7 on Ubuntu from the ubuntu-toolchain-r/test ppa. I do see a reference to __stack_chk_fail at grub-core/efiemu/runtime/efiemu.c:192. It doesn't look like that file is generated. Perhaps that function was accidentally added to that file?

It comes from using -fstack-protector GCC option. But configure should have added -fno-stack-protector in this case.

Could you check defaults using

/path/to/your/gcc -Q --help=common

whether it is active by default? Also whether -fno-stack-protector was used during compilation?

#5 lore raw
Quoted 27 lines · Andrey Borzenkov

В Fri, 8 Nov 2013 14:42:43 -0600
Glenn Washburn <[email protected]> пишет:

Quoted 15 lines
Quoted 11 lines · On Fri, 08 Nov 2013 19:54:43 +0100 Vladimir 'φ-coder/phcoder' Serbinenko…
Quoted 7 lines · Glenn Washburn

Now, I'm getting this error while building. Bug in the awk script?

cat syminfo.lst | sort | gawk -f ./grub.git/grub-core/genmoddep.awk

Quoted 2 lines

moddep.lst || (rm -f moddep.lst; exit 1) __stack_chk_fail in regexp is

not defined

What compiler do you use and which additional options did you pass to it? It inserted this function call. We need either to provide this function or inhibit compiler from emiting such calls.

Quoted 5 lines

I'm using gcc 4.7 on Ubuntu from the ubuntu-toolchain-r/test ppa. I do see a reference to __stack_chk_fail at grub-core/efiemu/runtime/efiemu.c:192. It doesn't look like that file is generated. Perhaps that function was accidentally added to that file?

It comes from using -fstack-protector GCC option. But configure should have added -fno-stack-protector in this case.

Quoted 7 lines

Could you check defaults using

/path/to/your/gcc -Q --help=common

whether it is active by default? Also whether -fno-stack-protector was used during compilation?

You're right.
@Glenn: can you tell us exact version of GRUB (e.g. git commit) and attach config.log?

Quoted 7 lines

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

#6 lore raw
Quoted 32 lines · On Sat, 09 Nov 2013 12:37:08 +0100 Vladimir 'φ-coder/phcoder' Serbinenko…
Quoted 31 lines · Andrey Borzenkov

В Fri, 8 Nov 2013 14:42:43 -0600
Glenn Washburn <[email protected]> пишет:

Quoted 17 lines
Quoted 6 lines · On Fri, 08 Nov 2013 19:54:43 +0100 Vladimir 'φ-coder/phcoder' Serbinenko…
Quoted 5 lines · Glenn Washburn

Now, I'm getting this error while building. Bug in the awk script?

cat syminfo.lst | sort | gawk
-f ./grub.git/grub-core/genmoddep.awk

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

moddep.lst || (rm -f moddep.lst; exit 1) __stack_chk_fail in regexp is

not defined

What compiler do you use and which additional options did you pass to it? It inserted this function call. We need either to provide this function or inhibit compiler from emiting such calls.

Quoted 5 lines

I'm using gcc 4.7 on Ubuntu from the ubuntu-toolchain-r/test ppa. I do see a reference to __stack_chk_fail at grub-core/efiemu/runtime/efiemu.c:192. It doesn't look like that file is generated. Perhaps that function was accidentally added to that file?

It comes from using -fstack-protector GCC option. But configure should have added -fno-stack-protector in this case.

Could you check defaults using

Quoted 8 lines
Quoted 5 lines

/path/to/your/gcc -Q --help=common

whether it is active by default? Also whether -fno-stack-protector was used during compilation?

You're right.
@Glenn: can you tell us exact version of GRUB (e.g. git commit) and attach config.log?

The commit for these logs is 9612ebc00ef5f186e9084b60ceeb1606d34f1d23.

It looks like stack protector is disabled in gcc and I don't believe that -fno-stack-protector is being used.

The following options are language-independent:

  --debug                     		
  --dump                      		
  --dump=                     		
  --dumpbase                  		
  --dumpdir                   		
  --extra-warnings            		
  --help                      		[disabled]
  --help=<class>              		
  --no-warnings               		
  --optimize                  		
  --output                    		
  --output=                   		
  --param <param>=<value>     		
  --param=                    		
  --pedantic                  		
  --pedantic-errors           		
  --profile                   		
  --target-help               		
  --verbose                   		
  --version                   		
  -O<number>                  		
  -Ofast                      		
  -Os                         		
  -W                          		
  -Waggregate-return          		[disabled]
  -Warray-bounds              		[disabled]
  -Wattributes                		[enabled]
  -Wcast-align                		[disabled]
  -Wcoverage-mismatch         		[enabled]
  -Wcpp                       		[enabled]
  -Wdeprecated-declarations   		[enabled]
  -Wdisabled-optimization     		[disabled]
  -Werror                     		[disabled]
  -Werror=                    		
  -Wextra                     		[disabled]
  -Wfatal-errors              		[disabled]
  -Wframe-larger-than=<number> 		
  -Wfree-nonheap-object       		[enabled]
  -Winline                    		[disabled]
  -Winvalid-memory-model      		[enabled]
  -Wlarger-than-              		
  -Wlarger-than=<number>      		
  -Wmaybe-uninitialized       		[disabled]
  -Wmissing-noreturn          		[disabled]
  -Woverflow                  		[enabled]
  -Wpacked                    		[disabled]
  -Wpadded                    		[disabled]
  -Wshadow                    		[disabled]
  -Wstack-protector           		[disabled]
  -Wstack-usage=              		0xffffffff
  -Wstrict-aliasing           		
  -Wstrict-aliasing=          		0xffffffff
  -Wstrict-overflow           		
  -Wstrict-overflow=          		0xffffffff
  -Wsuggest-attribute=const   		[disabled]
  -Wsuggest-attribute=noreturn 		[disabled]
  -Wsuggest-attribute=pure    		[disabled]
  -Wswitch                    		[disabled]
  -Wswitch-default            		[disabled]
  -Wswitch-enum               		[disabled]
  -Wsystem-headers            		[disabled]
  -Wtrampolines               		[disabled]
  -Wtype-limits               		[enabled]
  -Wuninitialized             		[enabled]
  -Wunreachable-code          		
  -Wunsafe-loop-optimizations 		[disabled]
  -Wunused                    		[disabled]
  -Wunused-but-set-parameter  		[enabled]
  -Wunused-but-set-variable   		[enabled]
  -Wunused-function           		[enabled]
  -Wunused-label              		[enabled]
  -Wunused-parameter          		[enabled]
  -Wunused-value              		[enabled]
  -Wunused-variable           		[enabled]
  -Wvector-operation-performance 	[disabled]
  -aux-info <file>            		[enabled]
  -aux-info=                  		
  -auxbase                    		[enabled]
  -auxbase-strip              		
  -d<letters>                 		
  -dumpbase <file>            		[enabled]
  -dumpdir <dir>              		[enabled]
  -fPIC                       		[disabled]
  -fPIE                       		[disabled]
  -fabi-version=              		0x2
  -falign-functions           		[disabled]
  -falign-functions=          		0x1
  -falign-jumps               		[disabled]
  -falign-jumps=              		0x1
  -falign-labels              		[disabled]
  -falign-labels=             		0x1
  -falign-loops               		[disabled]
  -falign-loops=              		0x1
  -fargument-alias            		
  -fargument-noalias          		
  -fargument-noalias-anything 		
  -fargument-noalias-global   		
  -fassociative-math          		[disabled]
  -fasynchronous-unwind-tables 		[enabled]
  -fauto-inc-dec              		[enabled]
  -fbounds-check              		[disabled]
  -fbranch-count-reg          		[enabled]
  -fbranch-probabilities      		[disabled]
  -fbranch-target-load-optimize 	[disabled]
  -fbranch-target-load-optimize2 	[disabled]
  -fbtr-bb-exclusive          		[disabled]
  -fcall-saved-<register>     		
  -fcall-used-<register>      		
  -fcaller-saves              		[disabled]
  -fcheck-data-deps           		[disabled]
  -fcombine-stack-adjustments 		[disabled]
  -fcommon                    		[enabled]
  -fcompare-debug-second      		[disabled]
  -fcompare-debug[=<opts>]    		
  -fcompare-elim              		[disabled]
  -fconserve-stack            		[disabled]
  -fcprop-registers           		[disabled]
  -fcrossjumping              		[disabled]
  -fcse-follow-jumps          		[disabled]
  -fcse-skip-blocks           		
  -fcx-fortran-rules          		[disabled]
  -fcx-limited-range          		[disabled]
  -fdata-sections             		[disabled]
  -fdbg-cnt-list              		
  -fdbg-cnt=<counter>:<limit>[,<counter>:<limit>,...] 	
  -fdce                       		[enabled]
  -fdebug-prefix-map=         		
  -fdebug-types-section       		[enabled]
  -fdefer-pop                 		[disabled]
  -fdelayed-branch            		[disabled]
  -fdelete-null-pointer-checks 		[enabled]
  -fdevirtualize              		[disabled]
  -fdiagnostics-show-location=[once|every-line] 	
  -fdiagnostics-show-option   		[enabled]
  -fdisable-                  		
  -fdse                       		[enabled]
  -fdump-<type>               		
  -fdump-final-insns=filename 		
  -fdump-go-spec=filename     		
  -fdump-noaddr               		[disabled]
  -fdump-passes               		[disabled]
  -fdump-unnumbered           		[disabled]
  -fdump-unnumbered-links     		[disabled]
  -fdwarf2-cfi-asm            		[enabled]
  -fearly-inlining            		[enabled]
  -feliminate-dwarf2-dups     		[disabled]
  -feliminate-unused-debug-symbols 	[disabled]
  -feliminate-unused-debug-types 	[enabled]
  -femit-class-debug-always   		[disabled]
  -fenable-                   		
  -fexceptions                		[disabled]
  -fexcess-precision=[fast|standard] 	[default]
  -fexpensive-optimizations   		[disabled]
  -ffast-math                 		
  -ffat-lto-objects           		[enabled]
  -ffinite-math-only          		[disabled]
  -ffixed-<register>          		
  -ffloat-store               		[disabled]
  -fforce-addr                		
  -fforward-propagate         		[disabled]
  -ffp-contract=              		fast
  -ffunction-cse              		[enabled]
  -ffunction-sections         		[disabled]
  -fgcse                      		[disabled]
  -fgcse-after-reload         		[disabled]
  -fgcse-las                  		[disabled]
  -fgcse-lm                   		[enabled]
  -fgcse-sm                   		[disabled]
  -fgnu-tm                    		[disabled]
  -fgraphite                  		[disabled]
  -fgraphite-identity         		[disabled]
  -fguess-branch-probability  		[disabled]
  -fhelp                      		
  -fhelp=                     		
  -fident                     		[enabled]
  -fif-conversion             		[disabled]
  -fif-conversion2            		[disabled]
  -findirect-inlining         		[disabled]
  -finhibit-size-directive    		[disabled]
  -finline                    		[enabled]
  -finline-atomics            		[enabled]
  -finline-functions          		[disabled]
  -finline-functions-called-once 	[disabled]
  -finline-limit-             		
  -finline-limit=<number>     		
  -finline-small-functions    		[disabled]
  -finstrument-functions      		[disabled]
  -finstrument-functions-exclude-file-list= 	
  -finstrument-functions-exclude-function-list= 	
  -fipa-cp                    		[disabled]
  -fipa-cp-clone              		[disabled]
  -fipa-matrix-reorg          		[disabled]
  -fipa-profile               		[disabled]
  -fipa-pta                   		[disabled]
  -fipa-pure-const            		[disabled]
  -fipa-reference             		[disabled]
  -fipa-sra                   		[disabled]
  -fipa-struct-reorg          		
  -fira-algorithm=            		CB
  -fira-loop-pressure         		[disabled]
  -fira-region=               		[default]
  -fira-share-save-slots      		[enabled]
  -fira-share-spill-slots     		[enabled]
  -fira-verbose=<number>      		0x5
  -fivopts                    		[enabled]
  -fjump-tables               		[enabled]
  -fkeep-inline-functions     		[disabled]
  -fkeep-static-consts        		[enabled]
  -fleading-underscore        		[enabled]
  -floop-block                		[disabled]
  -floop-flatten              		[disabled]
  -floop-interchange          		[disabled]
  -floop-optimize             		
  -floop-parallelize-all      		[disabled]
  -floop-strip-mine           		[disabled]
  -flto                       		
  -flto-compression-level=<number> 	0xffffffff
  -flto-partition=1to1        		[disabled]
  -flto-partition=balanced    		[disabled]
  -flto-partition=none        		[disabled]
  -flto-report                		[disabled]
  -flto=                      		
  -fmath-errno                		[enabled]
  -fmax-errors=<number>       		0
  -fmem-report                		[disabled]
  -fmerge-all-constants       		[disabled]
  -fmerge-constants           		[disabled]
  -fmerge-debug-strings       		[enabled]
  -fmessage-length=<number>   		
  -fmodulo-sched              		[disabled]
  -fmodulo-sched-allow-regmoves 	[disabled]
  -fmove-loop-invariants      		[enabled]
  -fnon-call-exceptions       		[disabled]
  -fomit-frame-pointer        		[disabled]
  -foptimize-register-move    		[disabled]
  -foptimize-sibling-calls    		[disabled]
  -foptimize-strlen           		[disabled]
  -fpack-struct               		[disabled]
  -fpack-struct=<number>      		
  -fpartial-inlining          		[disabled]
  -fpcc-struct-return         		[disabled]
  -fpeel-loops                		[disabled]
  -fpeephole                  		[enabled]
  -fpeephole2                 		[disabled]
  -fpic                       		[disabled]
  -fpie                       		[disabled]
  -fplugin-arg-<name>-<key>[=<value>] 	
  -fplugin=                   		
  -fpost-ipa-mem-report       		[disabled]
  -fpre-ipa-mem-report        		[disabled]
  -fpredictive-commoning      		[disabled]
  -fprefetch-loop-arrays      		[enabled]
  -fprofile                   		[disabled]
  -fprofile-arcs              		[disabled]
  -fprofile-correction        		[disabled]
  -fprofile-dir=              		
  -fprofile-generate          		
  -fprofile-generate=         		
  -fprofile-use               		[disabled]
  -fprofile-use=              		
  -fprofile-values            		[disabled]
  -frandom-seed               		
  -frandom-seed=<string>      		
  -freciprocal-math           		[disabled]
  -frecord-gcc-switches       		[disabled]
  -free                       		[disabled]
  -freg-struct-return         		[disabled]
  -fregmove                   		[disabled]
  -frename-registers          		[enabled]
  -freorder-blocks            		[disabled]
  -freorder-blocks-and-partition 	[disabled]
  -freorder-functions         		[disabled]
  -frerun-cse-after-loop      		[disabled]
  -frerun-loop-opt            		
  -freschedule-modulo-scheduled-loops 	[disabled]
  -frounding-math             		[disabled]
  -fsched-critical-path-heuristic 	[enabled]
  -fsched-dep-count-heuristic 		[enabled]
  -fsched-group-heuristic     		[enabled]
  -fsched-interblock          		[enabled]
  -fsched-last-insn-heuristic 		[enabled]
  -fsched-pressure            		[disabled]
  -fsched-pressure-algorithm= 		weighted
  -fsched-rank-heuristic      		[enabled]
  -fsched-spec                		[enabled]
  -fsched-spec-insn-heuristic 		[enabled]
  -fsched-spec-load           		[disabled]
  -fsched-spec-load-dangerous 		[disabled]
  -fsched-stalled-insns       		[disabled]
  -fsched-stalled-insns-dep   		[enabled]
  -fsched-stalled-insns-dep=<number> 	
  -fsched-stalled-insns=<number> 	
  -fsched-verbose=<number>    		0
  -fsched2-use-superblocks    		[disabled]
  -fsched2-use-traces         		
  -fschedule-insns            		[disabled]
  -fschedule-insns2           		[disabled]
  -fsection-anchors           		[disabled]
  -fsee                       		
  -fsel-sched-pipelining      		[disabled]
  -fsel-sched-pipelining-outer-loops 	[disabled]
  -fsel-sched-reschedule-pipelined 	[disabled]
  -fselective-scheduling      		[disabled]
  -fselective-scheduling2     		[disabled]
  -fshow-column               		[enabled]
  -fshrink-wrap               		[disabled]
  -fsignaling-nans            		[disabled]
  -fsigned-zeros              		[enabled]
  -fsingle-precision-constant 		[disabled]
  -fsplit-ivs-in-unroller     		[enabled]
  -fsplit-stack               		[enabled]
  -fsplit-wide-types          		[disabled]
  -fstack-check               		
  -fstack-check=[no|generic|specific] 	
  -fstack-limit               		
  -fstack-limit-register=<register> 	
  -fstack-limit-symbol=<name> 		
  -fstack-protector           		[disabled]
  -fstack-protector-all       		[disabled]
  -fstack-usage               		[disabled]
  -fstrength-reduce           		
  -fstrict-aliasing           		[disabled]
  -fstrict-overflow           		[disabled]
  -fstrict-volatile-bitfields 		[enabled]
  -fsyntax-only               		[disabled]
  -ftarget-help               		
  -ftest-coverage             		[disabled]
  -fthread-jumps              		[disabled]
  -ftime-report               		[disabled]
  -ftls-model=[global-dynamic|local-dynamic|initial-exec|local-exec] 	global-
                              dynamic
  -ftoplevel-reorder          		[enabled]
  -ftracer                    		[disabled]
  -ftrapping-math             		[enabled]
  -ftrapv                     		[disabled]
  -ftree-bit-ccp              		[disabled]
  -ftree-builtin-call-dce     		[disabled]
  -ftree-ccp                  		[disabled]
  -ftree-ch                   		[disabled]
  -ftree-coalesce-inlined-vars 		[disabled]
  -ftree-coalesce-vars        		[enabled]
  -ftree-copy-prop            		[disabled]
  -ftree-copyrename           		[disabled]
  -ftree-cselim               		[enabled]
  -ftree-dce                  		[disabled]
  -ftree-dominator-opts       		[disabled]
  -ftree-dse                  		[disabled]
  -ftree-forwprop             		[enabled]
  -ftree-fre                  		[disabled]
  -ftree-loop-distribute-patterns 	[disabled]
  -ftree-loop-distribution    		[disabled]
  -ftree-loop-if-convert      		[enabled]
  -ftree-loop-if-convert-stores 	[disabled]
  -ftree-loop-im              		[enabled]
  -ftree-loop-ivcanon         		[enabled]
  -ftree-loop-linear          		
  -ftree-loop-optimize        		[enabled]
  -ftree-lrs                  		[disabled]
  -ftree-parallelize-loops=   		0x1
  -ftree-partial-pre          		[disabled]
  -ftree-phiprop              		[enabled]
  -ftree-pre                  		[disabled]
  -ftree-pta                  		[enabled]
  -ftree-reassoc              		[enabled]
  -ftree-salias               		
  -ftree-scev-cprop           		[enabled]
  -ftree-sink                 		[disabled]
  -ftree-slp-vectorize        		[enabled]
  -ftree-sra                  		[disabled]
  -ftree-store-ccp            		
  -ftree-store-copy-prop      		
  -ftree-switch-conversion    		[disabled]
  -ftree-tail-merge           		[disabled]
  -ftree-ter                  		[disabled]
  -ftree-vect-loop-version    		[enabled]
  -ftree-vectorize            		[disabled]
  -ftree-vectorizer-verbose=<number> 	
  -ftree-vrp                  		[disabled]
  -funit-at-a-time            		[enabled]
  -funroll-all-loops          		[disabled]
  -funroll-loops              		[disabled]
  -funsafe-loop-optimizations 		[disabled]
  -funsafe-math-optimizations 		[disabled]
  -funswitch-loops            		[disabled]
  -funwind-tables             		[disabled]
  -fuse-ld=bfd                		[disabled]
  -fuse-ld=gold               		[disabled]
  -fuse-ld=ld.bfd             		
  -fuse-linker-plugin         		
  -fvar-tracking              		[enabled]
  -fvar-tracking-assignments  		[enabled]
  -fvar-tracking-assignments-toggle 	[disabled]
  -fvar-tracking-uninit       		[disabled]
  -fvariable-expansion-in-unroller 	[disabled]
  -fvect-cost-model           		[enabled]
  -fverbose-asm               		[disabled]
  -fversion                   		
  -fvisibility=[default|internal|hidden|protected] 	default
  -fvpt                       		[disabled]
  -fweb                       		[enabled]
  -fwhole-program             		[disabled]
  -fwrapv                     		[disabled]
  -fzee                       		
  -fzero-initialized-in-bss   		[enabled]
  -g                          		
  -gcoff                      		
  -gdwarf-                    		0x2
  -ggdb                       		
  -gno-record-gcc-switches    		[enabled]
  -gno-strict-dwarf           		[disabled]
  -grecord-gcc-switches       		[disabled]
  -gstabs                     		
  -gstabs+                    		
  -gstrict-dwarf              		[disabled]
  -gtoggle                    		[disabled]
  -gvms                       		
  -gxcoff                     		
  -gxcoff+                    		
  -imultiarch <dir>           		x86_64-linux-gnu
  -iplugindir=<dir>           		
  -o <file>                   		
  -p                          		[disabled]
  -pedantic                   		[disabled]
  -pedantic-errors            		[disabled]
  -quiet                      		[disabled]
  -v                          		[disabled]
  -version                    		[disabled]
  -w                          		[disabled]
#7 lore raw

В Sat, 9 Nov 2013 23:09:35 -0600
Glenn Washburn <[email protected]> пишет:

Quoted 40 lines
Quoted 37 lines · On Sat, 09 Nov 2013 12:37:08 +0100 Vladimir 'φ-coder/phcoder' Serbinenko…
Quoted 36 lines · Andrey Borzenkov

В Fri, 8 Nov 2013 14:42:43 -0600
Glenn Washburn <[email protected]> пишет:

Quoted 17 lines
Quoted 6 lines · On Fri, 08 Nov 2013 19:54:43 +0100 Vladimir 'φ-coder/phcoder' Serbinenko…
Quoted 5 lines · Glenn Washburn

Now, I'm getting this error while building. Bug in the awk script?

cat syminfo.lst | sort | gawk
-f ./grub.git/grub-core/genmoddep.awk

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

moddep.lst || (rm -f moddep.lst; exit 1) __stack_chk_fail in regexp is

not defined

What compiler do you use and which additional options did you pass to it? It inserted this function call. We need either to provide this function or inhibit compiler from emiting such calls.

Quoted 5 lines

I'm using gcc 4.7 on Ubuntu from the ubuntu-toolchain-r/test ppa. I do see a reference to __stack_chk_fail at grub-core/efiemu/runtime/efiemu.c:192. It doesn't look like that file is generated. Perhaps that function was accidentally added to that file?

It comes from using -fstack-protector GCC option. But configure should have added -fno-stack-protector in this case.

Could you check defaults using

/path/to/your/gcc -Q --help=common

whether it is active by default? Also whether -fno-stack-protector was used during compilation?

Quoted 9 lines
Quoted 3 lines

You're right.
@Glenn: can you tell us exact version of GRUB (e.g. git commit) and attach config.log?

The commit for these logs is 9612ebc00ef5f186e9084b60ceeb1606d34f1d23.

It looks like stack protector is disabled in gcc and I don't believe that -fno-stack-protector is being used.

Check for -fstack-protector is broken (always fails). Could you test with explicit

TARGET_CFLAGS="-Os -fno-stack-protector"

(-Os to emulate default behavior)?

#8 lore raw

В Sun, 10 Nov 2013 09:39:06 +0400
Andrey Borzenkov <[email protected]> пишет:

Quoted 47 lines

В Sat, 9 Nov 2013 23:09:35 -0600
Glenn Washburn <[email protected]> пишет:

Quoted 44 lines
Quoted 40 lines · On Sat, 09 Nov 2013 12:37:08 +0100 Vladimir 'φ-coder/phcoder' Serbinenko…
Quoted 29 lines · Andrey Borzenkov

В Fri, 8 Nov 2013 14:42:43 -0600
Glenn Washburn <[email protected]> пишет:

Quoted 17 lines
Quoted 6 lines · On Fri, 08 Nov 2013 19:54:43 +0100 Vladimir 'φ-coder/phcoder' Serbinenko…
Quoted 5 lines · Glenn Washburn

Now, I'm getting this error while building. Bug in the awk script?

cat syminfo.lst | sort | gawk
-f ./grub.git/grub-core/genmoddep.awk

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

moddep.lst || (rm -f moddep.lst; exit 1) __stack_chk_fail in regexp is

not defined

What compiler do you use and which additional options did you pass to it? It inserted this function call. We need either to provide this function or inhibit compiler from emiting such calls.

Quoted 5 lines

I'm using gcc 4.7 on Ubuntu from the ubuntu-toolchain-r/test ppa. I do see a reference to __stack_chk_fail at grub-core/efiemu/runtime/efiemu.c:192. It doesn't look like that file is generated. Perhaps that function was accidentally added to that file?

It comes from using -fstack-protector GCC option. But configure should have added -fno-stack-protector in this case.

Quoted 7 lines

Could you check defaults using

/path/to/your/gcc -Q --help=common

whether it is active by default? Also whether -fno-stack-protector was used during compilation?

You're right.
@Glenn: can you tell us exact version of GRUB (e.g. git commit) and attach config.log?

Quoted 7 lines
Quoted 5 lines

The commit for these logs is 9612ebc00ef5f186e9084b60ceeb1606d34f1d23.

It looks like stack protector is disabled in gcc and I don't believe that -fno-stack-protector is being used.

Check for -fstack-protector is broken (always fails).

OK I know what happens (grub checks misuse $ac_compile internal variable and as result mix host and target flags). Need some time to come up with a fix though.

#9 lore raw
In reply to Andrey Borzenkov

В Sun, 10 Nov 2013 09:39:06 +0400
Andrey Borzenkov <[email protected]> пишет:

Quoted 47 lines

В Sat, 9 Nov 2013 23:09:35 -0600
Glenn Washburn <[email protected]> пишет:

Quoted 44 lines
Quoted 40 lines · On Sat, 09 Nov 2013 12:37:08 +0100 Vladimir 'φ-coder/phcoder' Serbinenko…
Quoted 29 lines · Andrey Borzenkov

В Fri, 8 Nov 2013 14:42:43 -0600
Glenn Washburn <[email protected]> пишет:

Quoted 17 lines
Quoted 6 lines · On Fri, 08 Nov 2013 19:54:43 +0100 Vladimir 'φ-coder/phcoder' Serbinenko…
Quoted 5 lines · Glenn Washburn

Now, I'm getting this error while building. Bug in the awk script?

cat syminfo.lst | sort | gawk
-f ./grub.git/grub-core/genmoddep.awk

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

moddep.lst || (rm -f moddep.lst; exit 1) __stack_chk_fail in regexp is

not defined

What compiler do you use and which additional options did you pass to it? It inserted this function call. We need either to provide this function or inhibit compiler from emiting such calls.

Quoted 5 lines

I'm using gcc 4.7 on Ubuntu from the ubuntu-toolchain-r/test ppa. I do see a reference to __stack_chk_fail at grub-core/efiemu/runtime/efiemu.c:192. It doesn't look like that file is generated. Perhaps that function was accidentally added to that file?

It comes from using -fstack-protector GCC option. But configure should have added -fno-stack-protector in this case.

Quoted 7 lines

Could you check defaults using

/path/to/your/gcc -Q --help=common

whether it is active by default? Also whether -fno-stack-protector was used during compilation?

You're right.
@Glenn: can you tell us exact version of GRUB (e.g. git commit) and attach config.log?

Quoted 7 lines
Quoted 5 lines

The commit for these logs is 9612ebc00ef5f186e9084b60ceeb1606d34f1d23.

It looks like stack protector is disabled in gcc and I don't believe that -fno-stack-protector is being used.

Check for -fstack-protector is broken (always fails).

The problem is this commit:

commit 24f4e57c4684471da088c504dec0380886eece0c

Author: Vladimir Serbinenko <[email protected]>
Date:   Thu Nov 7 03:17:37 2013 +0100

* configure.ac: Prevent cflags leaking to subsequent tests by always resetting cflags to target_cflags in target tests.

It removed restoring of CFLAGS causing leakage of temporary CFLAGS into subsequent tests. This is also broke efiemu tests:

efiemu runtime: No (cannot compile with -m64 -mcmodel=large -mno-red-zone -nostdlib)

And reason why all tests fail

gcc ... -march=i386 -m32 -mrtd -mregparm=3 -falign-jumps=1
-falign-loops=1 -falign-functions=1 -freg-struct-return -mno-mmx -mno-sse -mno-sse2 -mno-3dnow -fno-dwarf2-cfi-asm -fno-asynchronous-unwind-tables -m64 -mcmodel=large -mno-red-zone -nostdlib -Wall -W '-I$(top_srcdir)/include' '-I$(top_builddir)/include' -DGRUB_MACHINE_PCBIOS=1 -DGRUB_MACHINE=I386_PC -DGRUB_TARGET_CPU_I386=1 conftest.c -S -fstack-protector -o conftest.s conftest.c:1:0: error: CPU you selected does not support x86-64 instruction set
conftest.c:1:0: error: CPU you selected does not support x86-64 instruction set
conftest.c:1:0: warning: -mregparm is ignored in 64-bit mode [enabled by default]

CFLAGS need to be preserved and restored around all compiler flag tests.

#10 lore raw
In reply to Andrey Borzenkov

В Sun, 10 Nov 2013 09:39:06 +0400
Andrey Borzenkov <[email protected]> пишет:

Quoted 47 lines

В Sat, 9 Nov 2013 23:09:35 -0600
Glenn Washburn <[email protected]> пишет:

Quoted 44 lines
Quoted 40 lines · On Sat, 09 Nov 2013 12:37:08 +0100 Vladimir 'φ-coder/phcoder' Serbinenko…
Quoted 29 lines · Andrey Borzenkov

В Fri, 8 Nov 2013 14:42:43 -0600
Glenn Washburn <[email protected]> пишет:

Quoted 17 lines
Quoted 6 lines · On Fri, 08 Nov 2013 19:54:43 +0100 Vladimir 'φ-coder/phcoder' Serbinenko…
Quoted 5 lines · Glenn Washburn

Now, I'm getting this error while building. Bug in the awk script?

cat syminfo.lst | sort | gawk
-f ./grub.git/grub-core/genmoddep.awk

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

moddep.lst || (rm -f moddep.lst; exit 1) __stack_chk_fail in regexp is

not defined

What compiler do you use and which additional options did you pass to it? It inserted this function call. We need either to provide this function or inhibit compiler from emiting such calls.

Quoted 5 lines

I'm using gcc 4.7 on Ubuntu from the ubuntu-toolchain-r/test ppa. I do see a reference to __stack_chk_fail at grub-core/efiemu/runtime/efiemu.c:192. It doesn't look like that file is generated. Perhaps that function was accidentally added to that file?

It comes from using -fstack-protector GCC option. But configure should have added -fno-stack-protector in this case.

Quoted 7 lines

Could you check defaults using

/path/to/your/gcc -Q --help=common

whether it is active by default? Also whether -fno-stack-protector was used during compilation?

You're right.
@Glenn: can you tell us exact version of GRUB (e.g. git commit) and attach config.log?

Quoted 7 lines
Quoted 5 lines

The commit for these logs is 9612ebc00ef5f186e9084b60ceeb1606d34f1d23.

It looks like stack protector is disabled in gcc and I don't believe that -fno-stack-protector is being used.

Check for -fstack-protector is broken (always fails).

The problem is this commit:

commit 24f4e57c4684471da088c504dec0380886eece0c

Author: Vladimir Serbinenko <[email protected]>
Date:   Thu Nov 7 03:17:37 2013 +0100

* configure.ac: Prevent cflags leaking to subsequent tests by always resetting cflags to target_cflags in target tests.

It removed restoring of CFLAGS causing leakage of temporary CFLAGS into subsequent tests that do not explicitly reset CFLAGS. This is also broke efiemu tests:

efiemu runtime: No (cannot compile with -m64 -mcmodel=large -mno-red-zone -nostdlib)

And reason why all tests fail

gcc ... -march=i386 -m32 -mrtd -mregparm=3 -falign-jumps=1
-falign-loops=1 -falign-functions=1 -freg-struct-return -mno-mmx -mno-sse -mno-sse2 -mno-3dnow -fno-dwarf2-cfi-asm -fno-asynchronous-unwind-tables -m64 -mcmodel=large -mno-red-zone -nostdlib -Wall -W '-I$(top_srcdir)/include' '-I$(top_builddir)/include' -DGRUB_MACHINE_PCBIOS=1 -DGRUB_MACHINE=I386_PC -DGRUB_TARGET_CPU_I386=1 conftest.c -S -fstack-protector -o conftest.s conftest.c:1:0: error: CPU you selected does not support x86-64 instruction set
conftest.c:1:0: error: CPU you selected does not support x86-64 instruction set
conftest.c:1:0: warning: -mregparm is ignored in 64-bit mode [enabled by default]

CFLAGS need to be preserved and restored around all compiler flag tests; or all tests need to explicitly set them.

#11 lore raw
Quoted 74 lines · Andrey Borzenkov

В Sun, 10 Nov 2013 09:39:06 +0400
Andrey Borzenkov <[email protected]> пишет:

Quoted 47 lines

В Sat, 9 Nov 2013 23:09:35 -0600
Glenn Washburn <[email protected]> пишет:

Quoted 44 lines
Quoted 40 lines · On Sat, 09 Nov 2013 12:37:08 +0100 Vladimir 'φ-coder/phcoder' Serbinenko…
Quoted 29 lines · Andrey Borzenkov

В Fri, 8 Nov 2013 14:42:43 -0600
Glenn Washburn <[email protected]> пишет:

Quoted 17 lines
Quoted 6 lines · On Fri, 08 Nov 2013 19:54:43 +0100 Vladimir 'φ-coder/phcoder' Serbinenko…
Quoted 5 lines · Glenn Washburn

Now, I'm getting this error while building. Bug in the awk script?

cat syminfo.lst | sort | gawk
-f ./grub.git/grub-core/genmoddep.awk

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

moddep.lst || (rm -f moddep.lst; exit 1) __stack_chk_fail in regexp is

not defined

What compiler do you use and which additional options did you pass to it? It inserted this function call. We need either to provide this function or inhibit compiler from emiting such calls.

Quoted 5 lines

I'm using gcc 4.7 on Ubuntu from the ubuntu-toolchain-r/test ppa. I do see a reference to __stack_chk_fail at grub-core/efiemu/runtime/efiemu.c:192. It doesn't look like that file is generated. Perhaps that function was accidentally added to that file?

It comes from using -fstack-protector GCC option. But configure should have added -fno-stack-protector in this case.

Quoted 7 lines

Could you check defaults using

/path/to/your/gcc -Q --help=common

whether it is active by default? Also whether -fno-stack-protector was used during compilation?

You're right.
@Glenn: can you tell us exact version of GRUB (e.g. git commit) and attach config.log?

Quoted 7 lines
Quoted 5 lines

The commit for these logs is 9612ebc00ef5f186e9084b60ceeb1606d34f1d23.

It looks like stack protector is disabled in gcc and I don't believe that -fno-stack-protector is being used.

Check for -fstack-protector is broken (always fails).

The problem is this commit:

commit 24f4e57c4684471da088c504dec0380886eece0c

Author: Vladimir Serbinenko <[email protected]>
Date:   Thu Nov 7 03:17:37 2013 +0100

* configure.ac: Prevent cflags leaking to subsequent tests by always resetting cflags to target_cflags in target tests.

It removed restoring of CFLAGS causing leakage of temporary CFLAGS into subsequent tests that do not explicitly reset CFLAGS. This is also broke efiemu tests:

efiemu runtime: No (cannot compile with -m64 -mcmodel=large -mno-red-zone -nostdlib)

And reason why all tests fail

Quoted 8 lines

gcc ... -march=i386 -m32 -mrtd -mregparm=3 -falign-jumps=1
-falign-loops=1 -falign-functions=1 -freg-struct-return -mno-mmx -mno-sse -mno-sse2 -mno-3dnow -fno-dwarf2-cfi-asm -fno-asynchronous-unwind-tables -m64 -mcmodel=large -mno-red-zone -nostdlib -Wall -W '-I$(top_srcdir)/include' '-I$(top_builddir)/include' -DGRUB_MACHINE_PCBIOS=1 -DGRUB_MACHINE=I386_PC -DGRUB_TARGET_CPU_I386=1 conftest.c -S -fstack-protector -o conftest.s conftest.c:1:0: error: CPU you selected does not support x86-64 instruction set
conftest.c:1:0: error: CPU you selected does not support x86-64 instruction set
conftest.c:1:0: warning: -mregparm is ignored in 64-bit mode [enabled by default]

CFLAGS need to be preserved and restored around all compiler flag tests; or all tests need to explicitly set them.

Fixed, thanks for spotting those tests.

Quoted 8 lines

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

#12 lore raw

В Sun, 10 Nov 2013 13:18:41 +0100
Vladimir 'φ-coder/phcoder' Serbinenko <[email protected]> пишет:

Quoted 1 line

Fixed, thanks for spotting those tests.

if test x"$efiemu_excuse" = x ; then
AC_CACHE_CHECK([whether options required for efiemu work], grub_cv_cc_efiemu,
[
- CFLAGS="$TARGET_CFLAGS -m64 -mcmodel=large -mno-red-zone -nostdlib"
+ CFLAGS="$TARGET_CFLAGS -march=core2 -m64 -mcmodel=large -mno-red-zone -nost
dlib"

That's still wrong. efiemuXX.o does not use TARGET_CFLAGS, this test will always fail on x86 because at this point TARGET_CFLAGS contains -m32 already.

#13 lore raw
Quoted 12 lines · Andrey Borzenkov

В Sun, 10 Nov 2013 13:18:41 +0100
Vladimir 'φ-coder/phcoder' Serbinenko <[email protected]> пишет:

Quoted 1 line

Fixed, thanks for spotting those tests.

if test x"$efiemu_excuse" = x ; then
AC_CACHE_CHECK([whether options required for efiemu work], grub_cv_cc_efiemu,
[

(quoted diff) +1 -1
-    CFLAGS="$TARGET_CFLAGS -m64 -mcmodel=large -mno-red-zone -nostdlib"
+    CFLAGS="$TARGET_CFLAGS -march=core2 -m64 -mcmodel=large -mno-red-zone -nost

dlib"

Quoted 4 lines

That's still wrong. efiemuXX.o does not use TARGET_CFLAGS, this test will always fail on x86 because at this point TARGET_CFLAGS contains -m32 already.

in "-m32 -m64" the last one takes precedence. But I'll adjust the test to be nearer to truth.

Quoted 7 lines

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

#14 lore raw
In reply to Vladimir 'φ-coder/phcoder' Serbinenko
Quoted 32 lines · On Sat, 09 Nov 2013 12:37:08 +0100 Vladimir 'φ-coder/phcoder' Serbinenko…
Quoted 31 lines · Andrey Borzenkov

В Fri, 8 Nov 2013 14:42:43 -0600
Glenn Washburn <[email protected]> пишет:

Quoted 17 lines
Quoted 6 lines · On Fri, 08 Nov 2013 19:54:43 +0100 Vladimir 'φ-coder/phcoder' Serbinenko…
Quoted 5 lines · Glenn Washburn

Now, I'm getting this error while building. Bug in the awk script?

cat syminfo.lst | sort | gawk
-f ./grub.git/grub-core/genmoddep.awk

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

moddep.lst || (rm -f moddep.lst; exit 1) __stack_chk_fail in regexp is

not defined

What compiler do you use and which additional options did you pass to it? It inserted this function call. We need either to provide this function or inhibit compiler from emiting such calls.

Quoted 5 lines

I'm using gcc 4.7 on Ubuntu from the ubuntu-toolchain-r/test ppa. I do see a reference to __stack_chk_fail at grub-core/efiemu/runtime/efiemu.c:192. It doesn't look like that file is generated. Perhaps that function was accidentally added to that file?

It comes from using -fstack-protector GCC option. But configure should have added -fno-stack-protector in this case.

Could you check defaults using

Quoted 8 lines
Quoted 5 lines

/path/to/your/gcc -Q --help=common

whether it is active by default? Also whether -fno-stack-protector was used during compilation?

You're right.
@Glenn: can you tell us exact version of GRUB (e.g. git commit) and attach config.log?

I can confirm that adding -fno-stack-protector to CFLAGS allows the compile to be successful. So it does indeed seem to be a problem with the configure script.

#15 lore raw

В Sat, 9 Nov 2013 23:33:54 -0600
Glenn Washburn <[email protected]> пишет:

Quoted 40 lines
Quoted 37 lines · On Sat, 09 Nov 2013 12:37:08 +0100 Vladimir 'φ-coder/phcoder' Serbinenko…
Quoted 36 lines · Andrey Borzenkov

В Fri, 8 Nov 2013 14:42:43 -0600
Glenn Washburn <[email protected]> пишет:

Quoted 17 lines
Quoted 6 lines · On Fri, 08 Nov 2013 19:54:43 +0100 Vladimir 'φ-coder/phcoder' Serbinenko…
Quoted 5 lines · Glenn Washburn

Now, I'm getting this error while building. Bug in the awk script?

cat syminfo.lst | sort | gawk
-f ./grub.git/grub-core/genmoddep.awk

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

moddep.lst || (rm -f moddep.lst; exit 1) __stack_chk_fail in regexp is

not defined

What compiler do you use and which additional options did you pass to it? It inserted this function call. We need either to provide this function or inhibit compiler from emiting such calls.

Quoted 5 lines

I'm using gcc 4.7 on Ubuntu from the ubuntu-toolchain-r/test ppa. I do see a reference to __stack_chk_fail at grub-core/efiemu/runtime/efiemu.c:192. It doesn't look like that file is generated. Perhaps that function was accidentally added to that file?

It comes from using -fstack-protector GCC option. But configure should have added -fno-stack-protector in this case.

Could you check defaults using

/path/to/your/gcc -Q --help=common

whether it is active by default? Also whether -fno-stack-protector was used during compilation?

Quoted 7 lines
Quoted 3 lines

You're right.
@Glenn: can you tell us exact version of GRUB (e.g. git commit) and attach config.log?

I can confirm that adding -fno-stack-protector to CFLAGS allows the compile to be successful. So it does indeed seem to be a problem with the configure script.

CFLAGS or TARGET_CFLAGS? CFLAGS should not be a problem, it is host tools which should work. It is TARGET_CFLAGS that are needed. If it is fixed by changing CFLAGS, we have another problem ...

#16 lore raw
Quoted 49 lines · On Sun, 10 Nov 2013 09:40:58 +0400 Andrey Borzenkov <[email protected]> wrote:

В Sat, 9 Nov 2013 23:33:54 -0600
Glenn Washburn <[email protected]> пишет:

Quoted 46 lines
Quoted 42 lines · On Sat, 09 Nov 2013 12:37:08 +0100 Vladimir 'φ-coder/phcoder' Serbinenko…
Quoted 31 lines · Andrey Borzenkov

В Fri, 8 Nov 2013 14:42:43 -0600
Glenn Washburn <[email protected]> пишет:

Quoted 19 lines
Quoted 6 lines · On Fri, 08 Nov 2013 19:54:43 +0100 Vladimir 'φ-coder/phcoder' Serbinenko…
Quoted 5 lines · Glenn Washburn

Now, I'm getting this error while building. Bug in the awk script?

cat syminfo.lst | sort | gawk
-f ./grub.git/grub-core/genmoddep.awk

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

moddep.lst || (rm -f moddep.lst; exit 1) __stack_chk_fail in regexp is

not defined

What compiler do you use and which additional options did you pass to it? It inserted this function call. We need either to provide this function or inhibit compiler from emiting such calls.

Quoted 5 lines

I'm using gcc 4.7 on Ubuntu from the ubuntu-toolchain-r/test ppa. I do see a reference to __stack_chk_fail at grub-core/efiemu/runtime/efiemu.c:192. It doesn't look like that file is generated. Perhaps that function was accidentally added to that file?

It comes from using -fstack-protector GCC option. But configure should have added -fno-stack-protector in this case.

Quoted 7 lines

Could you check defaults using

/path/to/your/gcc -Q --help=common

whether it is active by default? Also whether
-fno-stack-protector was used during compilation?

You're right.
@Glenn: can you tell us exact version of GRUB (e.g. git commit) and attach config.log?

Quoted 7 lines
Quoted 3 lines

I can confirm that adding -fno-stack-protector to CFLAGS allows the compile to be successful. So it does indeed seem to be a problem with the configure script.

CFLAGS or TARGET_CFLAGS? CFLAGS should not be a problem, it is host tools which should work. It is TARGET_CFLAGS that are needed. If it is fixed by changing CFLAGS, we have another problem ...

You may have discovered already the problem, but I wanted to confirm that it was CFLAGS, not TARGET_CFLAGS, that I set to -fno-stack-protector.