public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Yash.Shinde@windriver.com
To: openembedded-core@lists.openembedded.org
Cc: Randy.MacLeod@windriver.com, Naveen.Gowda@windriver.com,
	Sundeep.Kokkonda@windriver.com, sunilkumar.dora@windriver.com,
	Yash.Shinde@windriver.com
Subject: [PATCH v2 3/3] zlib: Enable PIE for native builds
Date: Thu, 29 Aug 2024 01:33:56 -0700	[thread overview]
Message-ID: <20240829083358.1277849-3-Yash.Shinde@windriver.com> (raw)
In-Reply-To: <20240829083358.1277849-1-Yash.Shinde@windriver.com>

From: Yash Shinde <Yash.Shinde@windriver.com>

The zlib crate in rust uses libz.a which comes from the zlib-native build.
Some distros like alma9, fedora etc. do not have PIE enabled by default for system compiler.

This leads to target-rust-ccld linking error for cargo-native as (line no 22936):
error: linking with `/home/pokybuild/yocto-worker/qemuarm64/build/build/tmp/work/x86_64-linux/cargo-native/1.79.0/wrapper/target-rust-ccld` failed: exit status: 1

https://autobuilder.yoctoproject.org/typhoon/#/builders/42/builds/9385/steps/13/logs/stdio

Hence, enable PIE option to CFLAGS for native builds.

Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
---
 meta/recipes-core/zlib/zlib_1.3.1.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-core/zlib/zlib_1.3.1.bb b/meta/recipes-core/zlib/zlib_1.3.1.bb
index 486431dfff..e62c50c5df 100644
--- a/meta/recipes-core/zlib/zlib_1.3.1.bb
+++ b/meta/recipes-core/zlib/zlib_1.3.1.bb
@@ -19,7 +19,7 @@ SRC_URI[sha256sum] = "9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b
 # to PREMIRRORS so it is also searched automatically.
 PREMIRRORS:append = " https://zlib.net/ https://zlib.net/fossils/"
 
-CFLAGS += "-D_REENTRANT"
+CFLAGS += "-D_REENTRANT -fPIE"
 
 RDEPENDS:${PN}-ptest += "make"
 
-- 
2.43.0



      parent reply	other threads:[~2024-08-29  8:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-29  8:33 [PATCH v2 1/3] rust: Oe-selftest changes for rust v1.79 Yash.Shinde
2024-08-29  8:33 ` [PATCH v2 2/3] rust: Upgrade 1.78.0->1.79.0 Yash.Shinde
2024-08-29  8:33 ` Yash.Shinde [this message]

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=20240829083358.1277849-3-Yash.Shinde@windriver.com \
    --to=yash.shinde@windriver.com \
    --cc=Naveen.Gowda@windriver.com \
    --cc=Randy.MacLeod@windriver.com \
    --cc=Sundeep.Kokkonda@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=sunilkumar.dora@windriver.com \
    /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