On Mon, Jul 31, 2017 at 7:04 PM, H.J. Lu <hjl.to...@gmail.com> wrote: > On Mon, Jul 31, 2017 at 5:37 PM, Alan Modra <amo...@gmail.com> wrote: >> On Mon, Jul 31, 2017 at 08:04:13AM -0700, H.J. Lu wrote: >>> On Mon, Jul 24, 2017 at 10:24 AM, H.J. Lu <hjl.to...@gmail.com> wrote: >>> > On Sun, Jul 23, 2017 at 8:14 AM, H.J. Lu <hjl.to...@gmail.com> wrote: >>> >> -static and -pie together behave differently depending on whether GCC is >>> >> configured with --enable-default-pie. On x86, "-static -pie" fails to >>> >> create executable when --enable-default-pie isn't used, but creates a >>> >> static executable when --enable-default-pie is used. This patch makes >>> >> -static completely override -pie to create a static executable, >>> >> regardless >>> >> if --enable-default-pie is used to configure GCC. >>> >> >>> >> OK for master? >>> >> >>> >> H.J. >>> >> -- >>> >> 2017-07-23 Alan Modra <amo...@gmail.com> >>> >> H.J. Lu <hongjiu...@intel.com> >>> >> >>> >> gcc/ >>> >> >>> >> PR driver/81523 >>> >> * gcc.c (NO_PIE_SPEC): Delete. >>> >> (PIE_SPEC): Define as !no-pie/pie. Move static|shared|r >>> >> exclusion.. >>> >> (LINK_PIE_SPEC): ..to here. >>> >> * config/gnu-user.h (GNU_USER_TARGET_STARTFILE_SPEC): Correct >>> >> chain of crtbegin*.o selection, update for PIE_SPEC changes and >>> >> format. >>> >> (GNU_USER_TARGET_ENDFILE_SPEC): Similarly. >>> >> * config/sol2.h (STARTFILE_CRTBEGIN_SPEC): Similarly. >>> >> (ENDFILE_CRTEND_SPEC): Similarly. >>> >> >>> > >>> > We need to add %{no-pie:} to LINK_COMMAND_SPEC to prevent an error >>> > message when PIE isn't enabled by default. Here is the updated patch >>> > with >>> > a testcase. >>> > >>> >>> PING. I am enclosing the patch here. >> >> For anyone looking at this, the patch enclosed here is mine from >> https://gcc.gnu.org/ml/gcc-patches/2017-06/msg01678.html minus some PR >> numbers and the powerpc specific part, plus testsuite (which looks to >> me like HJ copied pie-static-1.c to pie-static-2.c then forgot to >> change the order of -pie and -static), plus a tweak to >> LINK_COMMAND_SPEC. The LINK_COMMAND_SPEC change looks good to me, >> except for the comment which doesn't exactly match the code. That >> change is necessary because I ignorantly removed %{no-pie:} from >> LINK_PIE_SPEC without adding it back elsewhere. > > Here is the updated patch. >
Hi Joseph, Can you take a look at this patch: https://gcc.gnu.org/ml/gcc-patches/2017-08/msg00011.html Thanks. -- H.J.