From: Andrei Borzenkov <arvidjaar@gmail.com>
To: Magnus Granberg <zorry@gentoo.org>,
bug-grub@gnu.org,
The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: [PING] Re: Add check for -no-pie if the compiler default to -fPIE
Date: Sun, 6 Nov 2016 10:05:53 +0300 [thread overview]
Message-ID: <cc3b7c56-6549-e477-848e-3a8c431c6eee@gmail.com> (raw)
In-Reply-To: <12652458.r27xAZC8Yp@laptop1.gw.ume.nu>
21.10.2016 00:26, Magnus Granberg пишет:
> lördag 21 maj 2016 kl. 20:53:48 CEST skrev du:
>> On Saturday 21 May 2016 19.26.18 you wrote:
>>> 21.05.2016 19:02, Magnus Granberg пишет:
>>>> On Saturday 21 May 2016 18.55.11 you wrote:
>>>>> 21.05.2016 17:47, Magnus Granberg пишет:
>>>>>> When Grub is compile with gcc 6.1 that have --enable-defult-pie set.
>>>>>> It fail with.
>>>>>> -ffreestanding -m32 -Wl,-melf_i386 -Wl,--build-id=none -nostdlib
>>>>>> -Wl,-N
>>>>>> -Wl,-r,-d - o trig.module trig_module-trigtables.o
>>>>>> grep 'MARKER' gcry_whirlpool.marker.new > gcry_whirlpool.marker; rm -f
>>>>>> gcry_whirlpool.marker.new
>>>>>> /usr/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../x86_64-pc-linux-gnu
>>>>>> /b
>>>>>> in
>>>>>> /ld: -r and - shared may not be used together
>>>>>> collect2: error: ld returned 1 exit status
>>>>>> Makefile:26993: recipe for target 'trig.module' failed
>>>>>>
>>>>>>
>>>>>> 2016-05-21 Magnus Granberg <zorry@gentoo.org>
>>>>>>
>>>>>> acinclude.m4: Add check for -no-pie. configure.ac: Add -no-pie to
>>>>>>
>>>>>> TARGET_LDFLAGS if needed.
>>>>>> ...
>>>>>
>>>>> Please test with current master:
>>>>>
>>>>> commit f4d35d49e32c29183b3492da18ea480d91716efe
>>>>> Author: Andrei Borzenkov <arvidjaar@gmail.com>
>>>>> Date: Tue Mar 22 20:12:22 2016 +0300
>>>>>
>>>>> configure: set -fno-pie together with -fno-PIE
>>>>
>>>> Still fail the same way
>>>
>>> Please send full config.log and output of make.
>>
>> Gcc 6.1 pass -pie to the linker if is configure with --enable-default-pie
>> When linking with -r it don't mix well with -pie/-shared
>> Gentoo bug https://bugs.gentoo.org/show_bug.cgi?id=583042 with logs
>> Patch updated
> Any progres on this?
My apologies. Do we really need any explicit check for this? As far as I
can tell, options -fpie, -fPIE, -pie appeared in the same GCC release
(at least they first mentioned in 3.4 documentation together). Manual
also says that -fpie/-fPIE and -pie must be used together.
We do use $CC for linker - at least, by default. So it appears we should
be able to simply set -no-pie, no?
Does clang support -fpie/-fPIE/-(no-)pie options? I do not see them in
help output, but it does not say much.
Oh, BTW, you have typo in patch
> +[AC_MSG_CHECKING([whether linker accepts -no-pie])
> +AC_CACHE_VAL(grub_cv_cc_ld_nopie,
^^^^^
> +[save_LDFLAGS="$LDFLAGS"
> +LDFLAGS="$LDFLAGS -no-pie"
> +AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
> + [grub_cv_cc_ld_no_pie=yes],
> + [grub_cv_cc_ld_no_pie=no])
^^^^^^
parent reply other threads:[~2016-11-06 7:06 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <12652458.r27xAZC8Yp@laptop1.gw.ume.nu>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cc3b7c56-6549-e477-848e-3a8c431c6eee@gmail.com \
--to=arvidjaar@gmail.com \
--cc=bug-grub@gnu.org \
--cc=grub-devel@gnu.org \
--cc=zorry@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).