Closed ghost closed 2 years ago
try 'package set ldflags "-fPIE"'
-fPIE flag is used by linker.
I test out my target shell script with a toybox shell. Thanks for looking into it. I believe it has worked out for me in the end.
Bash use system-wide profile /etc/profile
, I don't change these config. I will look into this problem when have time.
"I believe it has worked out for me in the end."(the toybox shell solution).
The gcc man page says -fPIE is a Code Generation feature flag, doesn't occur anywhere else as a feature flag. An "-fpic" flag gets set by something else. I thought for awhile since that comes first, then "-fPIE" doesn't override the "fpic" flag.
yes, you are right, I removed the -fpic
flags from CFLAGS
and add -pie -fPIE
, it works now.
Just adding 'package set ccflags "-fPIE"' doesn't really work.