From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1agxeM-0000qe-Qz for mharc-grub-devel@gnu.org; Fri, 18 Mar 2016 12:53:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39532) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agxeK-0000pz-Np for grub-devel@gnu.org; Fri, 18 Mar 2016 12:53:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1agxeH-0006AS-Ew for grub-devel@gnu.org; Fri, 18 Mar 2016 12:53:20 -0400 Received: from mail-lb0-x231.google.com ([2a00:1450:4010:c04::231]:35242) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agxeH-00069g-26; Fri, 18 Mar 2016 12:53:17 -0400 Received: by mail-lb0-x231.google.com with SMTP id bc4so92439252lbc.2; Fri, 18 Mar 2016 09:53:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to; bh=S4LjeWhzUIlfHqyx7ZBA2NEvZeuknXYO/3sahZqBhqE=; b=bC7NIa/xryfXQ5IsXacJyyOpwCSSHJY+cjcDKI2sDksrWtbURNN0m5hrGj5tOF7a1g k7rNOxFrY1ZHUfiWpi593cCKCOj+NXtHHk6cO9G+3rOHch39l0vPH/W0Z3cSCaiiwT5H 2JA3AHs26uSzvMaz6tvtbXdIXp3vFLuCwIlQPZ+HQVhnU8SId+zPDnebinqr/jAFC8Ye LtJsXz+QGRTUL8bVY9hw9ug88llWf+581f1jSmuP2Zuk5XwnVlqoiWxN9JHCOQE10RWo t+F189D4BuKj3RKLqPgleL2QTJM2aYnnOJBvZculi2f+ld9/UUkkPTp+LIn2rJ4i/Ldq Bxlw== 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:cc:from:message-id:date :user-agent:mime-version:in-reply-to; bh=S4LjeWhzUIlfHqyx7ZBA2NEvZeuknXYO/3sahZqBhqE=; b=gisTXConBpn751MB5MZoTgRRNc2yAnEmEfuXTay8sNgLYoKndwXH8/LOguJw2GBhL6 kFa5ZcCUFx3hEnpuKhPDQE1AhfjvhNVs8VTz0GY7TZ0biPK0yqCGSSfkHziJ98NsRw0p svwL7tnfa6vqFeQhs1YCw6h/U/EfBtzIvzOZX7xtEoEAMfQhIH5A55tIY2Yo5+AXewrx V/KRkz64oBslIZkpBC5yN45wNu6+8zMOiHY4N7cPdFzHq7jFbBz8t88D/9ee2uEHdBsf z6I90ZKbC6yy/RfEx/Oz1va56ZsPMMfkzUQQVdx/GLgnyBKmm62vb0+WYzzEVDEyO+Qv W52Q== X-Gm-Message-State: AD7BkJKQmScNwKFDcLMno5Zq96zUBhSYlxxNta5+q/SUCw0klsU7kZCtvtnqj27hKff75w== X-Received: by 10.112.26.145 with SMTP id l17mr6563792lbg.106.1458319996106; Fri, 18 Mar 2016 09:53:16 -0700 (PDT) Received: from [192.168.1.42] (ppp109-252-76-159.pppoe.spdop.ru. [109.252.76.159]) by smtp.gmail.com with ESMTPSA id y3sm2304919lbk.40.2016.03.18.09.53.13 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 18 Mar 2016 09:53:14 -0700 (PDT) Subject: Re: [openbsd] 2.02-beta3: build fails - getroot.c:(.text+0x2b): undefined reference to `getrawpartition' To: Jiri B References: <20160312195423.GS17281@wolfman.devio.us> <56E4FD87.1040009@gmail.com> <20160314181957.GV17281@wolfman.devio.us> <56E706FC.4000905@gmail.com> <20160317101239.GY17281@wolfman.devio.us> <56EAD33C.2020805@gmail.com> <56EAD654.9080509@gmail.com> <20160317205641.GB32407@wolfman.devio.us> <56EB7577.2010503@gmail.com> <20160318130142.GE32407@wolfman.devio.us> From: Andrei Borzenkov Message-ID: <56EC3279.2020909@gmail.com> Date: Fri, 18 Mar 2016 19:53:13 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20160318130142.GE32407@wolfman.devio.us> Content-Type: multipart/mixed; boundary="------------060209000008010801070105" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c04::231 Cc: Vladimir 'phcoder' Serbinenko , The development of GNU GRUB , bug-grub@gnu.org X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 16:53:21 -0000 This is a multi-part message in MIME format. --------------060209000008010801070105 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 18.03.2016 16:01, Jiri B пишет: > On Fri, Mar 18, 2016 at 06:26:47AM +0300, Andrei Borzenkov wrote: >>> [...] >>> CFLAGS=-ftrampolines -fno-stack-protector -fno-pie -nopie >>> >>> So I gave it a try and it seems better (?) >>> >>> $ ls -l /home/jirib/openbsd/pobj/grub-2.02-beta3/fake-amd64/usr/local/lib/grub/i386-pc/lzma_decompress.im* >>> -rwxr-xr-x 1 jirib wheel 3068 Mar 17 21:45 /home/jirib/openbsd/pobj/grub-2.02-beta3/fake-amd64/usr/local/lib/grub/i386-pc/lzma_decompress.image* >>> -rw-r--r-- 1 jirib wheel 2832 Mar 17 21:45 /home/jirib/openbsd/pobj/grub-2.02-beta3/fake-amd64/usr/local/lib/grub/i386-pc/lzma_decompress.img >>> >>> $ objdump -f /home/jirib/openbsd/pobj/grub-2.02-beta3/fake-amd64/usr/local/lib/grub/i386-pc/lzma_decompress.image >>> >>> /home/jirib/openbsd/pobj/grub-2.02-beta3/fake-amd64/usr/local/lib/grub/i386-pc/lzma_decompress.image: file format elf32-i386 >>> architecture: i386, flags 0x00000002: >>> EXEC_P >>> start address 0x00008200 >>> >>> It is OK? >>> >> >> It certainly looks better than before. Does it actually work? >> >> We aready use -fno-PIE, looks like we need to explicitly check for >> -fno-pie as well. > > I just booted OpenBSD from "native OpenBSD" grub2: > Good. Please test attached patch. @Vladimir: I was unsure whether to add explicit -fpie test, but at the end I do not see what it buys us. Both options have been introduced at the same time and we want neither enabled. Current test covers both. Is it OK to commit? --------------060209000008010801070105 Content-Type: text/x-patch; name="fno-pie.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="fno-pie.patch" From: Andrei Borzenkov Subject: [PATCH] configure: set -fno-pie together with -fno-PIE OpenBSD 5.9 apparently defaults to -fpie. We use -fno-PIE when appropriate already, but that is not enough - it does not turn off -fpie. Actually check for -fPIE is not precise enough. __PIE__ is set for both -fpie and -fPIE but with different values. As far as I can tell, both options were introduced at the same time, so both should always be supported. This fixes compilation on OpenBSD 5.9 which otherwise created insanely big lzma_decompress.img. Reported, suggested and tested by: Jiri B --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index a85b134..57e1713 100644 --- a/configure.ac +++ b/configure.ac @@ -1185,9 +1185,9 @@ CFLAGS="$TARGET_CFLAGS" # Position independent executable. grub_CHECK_PIE [# Need that, because some distributions ship compilers that include -# `-fPIE' in the default specs. +# `-fPIE' or '-fpie' in the default specs. if [ x"$pie_possible" = xyes ]; then - TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE" + TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE -fno-pie" fi] CFLAGS="$TARGET_CFLAGS" -- tg: (76eac44..) u/fno-pie (depends on: master) --------------060209000008010801070105--