From: Veronika Kremneva <Veronika.Kremneva@synopsys.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] package/dmalloc: Fix for ARC with enabled BR2_SSP_ALL
Date: Tue, 9 Feb 2021 13:47:26 +0300 [thread overview]
Message-ID: <20210209104726.20132-1-kremneva@synopsys.com> (raw)
When building dmalloc for ARC while having "-fstack-protector-all" option on,
we are getting the following error:
------------------------------->8---------------------------
>>> dmalloc 5.5.2 Installing to target
cp -dpf $HOME/buildroot/output/host/arc-buildroot-linux-gnu/sysroot/usr/lib/libdmalloc*.so
$HOME/buildroot/output/target/usr/lib
cp -dpf $HOME/buildroot/output/host/arc-buildroot-linux-gnu/sysroot/usr/bin/dmalloc
$HOME/buildroot/output/target/usr/bin/dmalloc
ERROR: architecture for "/usr/lib/libdmallocthcxx.so" is "ARCompact", should be "ARCv2"
ERROR: architecture for "/usr/lib/libdmallocth.so" is "ARCompact", should be "ARCv2"
ERROR: architecture for "/usr/lib/libdmalloc.so" is "ARCompact", should be "ARCv2"
ERROR: architecture for "/usr/lib/libdmallocxx.so" is "ARCompact", should be "ARCv2"
make: *** [$HOME/buildroot/output/build/dmalloc-5.5.2/.stamp_installed] Error 1
------------------------------->8---------------------------
You can observe this error in following builds:
http://autobuild.buildroot.net/results/57f/57fc51cee4ec9339ea3be23f8c8c9f7ecca1a857/
http://autobuild.buildroot.net/results/b4d/b4d457369f35e1942c294b0ea3b3cab4cae0d7a3/
http://autobuild.buildroot.net/results/cfc/cfc111076c955dd5c1125c6e34a161121ea11200/
http://autobuild.buildroot.net/results/1d0/1d0ffcefbf545d1748e928603fd07c0a8de98eb5/
In all of those builds architecture "ARCv2" was explicitly chosen during configuration
yet we are getting this error. As we go deeper we find that the object file that linker
is trying to process contains no target code thus the default "ARCompact" is being used.
But why the object file is empty? Went to check link args:
------------------------------->8---------------------------
$HOME/buildroot/output/host/bin/arc-buildroot-linux-gnu-ld: conftest.a(conftest.o):
relocation R_ARC_32_ME against `__stack_chk_guard' can not be used when making a shared
object; recompile with -fPIC
$HOME/buildrootc/output/host/bin/arc-buildroot-linux-gnu-ld: BFD (GNU Binutils) 2.34.50.20200611
assertion fail elf32-arc.c:1802
$HOME/buildroot/output/host/bin/arc-buildroot-linux-gnu-ld: unrecognized option '-all'
$HOME/buildroot/output/host/bin/arc-buildroot-linux-gnu-ld: use the --help option for usage information
configure:4475: result: $HOME/buildroot/output/host/bin/arc-buildroot-linux-gnu-ld -G -o $@.t
------------------------------->8---------------------------
Looks like we are missing the -fPIC flag in DMALLOC_CFLAGS. As shared libraries should always
be compiled with "-fPIC" following patch adds this flag to the dmalloc.mk.
Signed-off-by: Veronika Kremneva <kremneva@synopsys.com>
---
package/dmalloc/dmalloc.mk | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/package/dmalloc/dmalloc.mk b/package/dmalloc/dmalloc.mk
index 38b2c02027..638fe0fcda 100644
--- a/package/dmalloc/dmalloc.mk
+++ b/package/dmalloc/dmalloc.mk
@@ -16,6 +16,10 @@ DMALLOC_INSTALL_STAGING = YES
DMALLOC_CONF_OPTS = --enable-shlib
DMALLOC_CFLAGS = $(TARGET_CFLAGS)
+ifeq ($(BR2_STATIC_LIBS),)
+DMALLOC_CFLAGS += -fPIC
+endif
+
ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
DMALLOC_CONF_OPTS += --enable-cxx
else
--
2.16.2
next reply other threads:[~2021-02-09 10:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-09 10:47 Veronika Kremneva [this message]
2021-02-10 21:45 ` [Buildroot] [PATCH] package/dmalloc: Fix for ARC with enabled BR2_SSP_ALL Yann E. MORIN
2021-02-12 20:19 ` Fabrice Fontaine
2021-02-13 8:27 ` Alexey Brodkin
[not found] ` <SN1PR12MB2351CE14450D2AF4FA2C36B5CA9D9@SN1PR12MB2351.namprd12.prod.outlook.com>
2021-03-03 12:22 ` Alexey Brodkin
2021-04-16 12:13 ` Veronika Kremneva
2021-04-16 12:42 ` Fabrice Fontaine
2021-05-15 15:12 ` Yann E. MORIN
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=20210209104726.20132-1-kremneva@synopsys.com \
--to=veronika.kremneva@synopsys.com \
--cc=buildroot@busybox.net \
/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