From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1c3HWm-00013f-2A for mharc-grub-devel@gnu.org; Sun, 06 Nov 2016 02:06:04 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37281) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c3HWk-00013V-BA for grub-devel@gnu.org; Sun, 06 Nov 2016 02:06:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c3HWf-0001tz-3A for grub-devel@gnu.org; Sun, 06 Nov 2016 02:06:02 -0500 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]:35481) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c3HWe-0001tM-Qu; Sun, 06 Nov 2016 02:05:57 -0500 Received: by mail-lf0-x244.google.com with SMTP id p100so7181014lfg.2; Sun, 06 Nov 2016 00:05:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=yF1IU4WyzUzNSEslN6OV7PxkKButvunbfn4zoSo7cIM=; b=SPQmZ3w8TeRg/THhHEVz6YXOQ/c/zuBZp+GULTmfYLXGzIgcpFN/YJfQ1FZtQgzVqo Z0I4HkgyUUYTW0XCmAvjmlF6lp1xoyEkiSqsIYbRCfllFZCRoQOif3fFzfKQHsyBNPp8 I6wGDCvobrzhjvfptbPqXmNVDZg6cbXPZUD8BfqhQVN/i7eHeN82jRXWw6rru2UgCof7 9RhLLQ5yPr5ed4NhgPHj6hIh3o5ZlVLp4KAWIn/chUH7gkkQ2SvwBcF5by8Z0fa3sgIS QEcU+JEH9lFq1zWI6M7SfClsvGm3MdtXjBsLBts6eXAtgf342Y1nCgw7iF67gxgxi0Se umyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=yF1IU4WyzUzNSEslN6OV7PxkKButvunbfn4zoSo7cIM=; b=hzX12ISgQTk8IgiVxkYGLifZfba7jfbBCtFQq/OEqr7n+jjvqpfGxNqELCl/ykiuKa F3jTG6v1Fl/w/LwHu0zGZW/jpJJp2STuVJ+D2VENqmQku/drkjQiTEWJexnq966bfc+g 37j2s3qbi440GZi7lfoTrCWVf52Mol1E3FyU76mTze92sWdo63nDCpK2GmKpkcc8LFvJ 40vthXdTLZTmgpQZzAfMQqfToNL7iMYt6IYhh2gaLkE9pWkNJ76I7OZQD9W0R7CSLX6A 4lB+uDgf5NoZIbYTtzxRyOwu6ockCwQaU3ujGA12rZdJ/410hJnMApzfD6cXFezbeFac i4JQ== X-Gm-Message-State: ABUngvcU7WvPI1hOK5yt9CukbOJoHfAR1jvV5MGuxhjeNAL/VHY6kcZ9ClA/SE5BKgaXmA== X-Received: by 10.25.202.6 with SMTP id a6mr631748lfg.30.1478415955200; Sun, 06 Nov 2016 00:05:55 -0700 (PDT) Received: from [192.168.1.44] (ppp109-252-90-55.pppoe.spdop.ru. [109.252.90.55]) by smtp.gmail.com with ESMTPSA id 135sm3931788ljj.32.2016.11.06.00.05.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 06 Nov 2016 00:05:54 -0700 (PDT) Subject: Re: [PING] Re: Add check for -no-pie if the compiler default to -fPIE To: Magnus Granberg , bug-grub@gnu.org, The development of GNU GRUB References: <3663776.51i7AZjjcS@laptop1.gw.ume.nu> <57408C2A.4060004@gmail.com> <2880117.m6htlZt9cc@laptop1.gw.ume.nu> <12652458.r27xAZC8Yp@laptop1.gw.ume.nu> From: Andrei Borzenkov Message-ID: Date: Sun, 6 Nov 2016 10:05:53 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <12652458.r27xAZC8Yp@laptop1.gw.ume.nu> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::244 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2016 07:06:03 -0000 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 >>>>>> >>>>>> 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 >>>>> 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]) ^^^^^^