From: Jonathan Liu <net147@gmail.com>
To: Dan McGregor <danismostlikely@gmail.com>
Cc: Patches and discussions about the oe-core layer
<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH 2/5] gcc-runtime: enable asan and tsan
Date: Fri, 05 Sep 2014 01:37:39 +1000 [thread overview]
Message-ID: <54088743.1010604@gmail.com> (raw)
In-Reply-To: <CACS+7ZQYOB6-nwmQ=dyHbj4Bg29Ce_iAuMtUBTZGkfDc8GfW+A@mail.gmail.com>
On 5/09/2014 1:28 AM, Dan McGregor wrote:
> On 4 September 2014 08:33, Jonathan Liu <net147@gmail.com> wrote:
>> On 30/08/2014 7:15 AM, Dan McGregor wrote:
>>> From: Dan McGregor <dan.mcgregor@usask.ca>
>>>
>>> ASan and TSan are useful debugging tools, enable them on the
>>> target and add the packages to packagegroup-core-sdk.
>>>
>>> Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca>
>>> ---
>>> .../recipes-core/packagegroups/packagegroup-core-sdk.bb | 4 +++-
>>> meta/recipes-devtools/gcc/gcc-runtime.inc | 17
>>> +++++++++++++++++
>>> 2 files changed, 20 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
>>> b/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
>>> index a544bbd..378336e 100644
>>> --- a/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
>>> +++ b/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
>>> @@ -28,7 +28,9 @@ RDEPENDS_packagegroup-core-sdk = "\
>>>
>>> RRECOMMENDS_packagegroup-core-sdk = "\
>>> libgomp \
>>> - libgomp-dev"
>>> + libgomp-dev \
>>> + libsanitizer \
>>> + libsanitizer-dev"
>>>
>>> #python generate_sdk_pkgs () {
>>> # poky_pkgs = read_pkgdata('packagegroup-core', d)['PACKAGES']
>>> diff --git a/meta/recipes-devtools/gcc/gcc-runtime.inc
>>> b/meta/recipes-devtools/gcc/gcc-runtime.inc
>>> index 7ce84f1..109f8dd 100644
>>> --- a/meta/recipes-devtools/gcc/gcc-runtime.inc
>>> +++ b/meta/recipes-devtools/gcc/gcc-runtime.inc
>>> @@ -11,6 +11,8 @@ EXTRA_OECONF_PATHS = "\
>>> EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu"
>>>
>>> RUNTIMETARGET = "libssp libstdc++-v3 libgomp libatomic"
>>> +RUNTIMETARGET_append_arm = " libsanitizer"
>>> +RUNTIMETARGET_append_x86 = " libsanitizer"
>>> # ?
>>> # libiberty
>>> # libmudflap
>>> @@ -88,6 +90,9 @@ PACKAGES = "\
>>> libatomic \
>>> libatomic-dev \
>>> libatomic-staticdev \
>>> + libsanitizer \
>>> + libsanitizer-dev \
>>> + libsanitizer-staticdev \
>>> "
>>> # The base package doesn't exist, so we clear the recommends.
>>> RRECOMMENDS_${PN}-dbg = ""
>>> @@ -171,6 +176,18 @@ FILES_libatomic-dev = "\
>>> "
>>> FILES_libatomic-staticdev = "${libdir}/libatomic.a"
>>>
>>> +FILES_libsanitizer = "${libdir}/libasan.so.* ${libdir}/libubsan.so.*"
>>> +FILES_libsanitizer-dev = " \
>>> + ${libdir}/libsanitizer.spec \
>>> + ${libdir}/libasan_preinit.o \
>>> + ${libdir}/libasan.so \
>>> + ${libdir}/libubsan.so \
>>> + ${libdir}/libasan.la \
>>> + ${libdir}/libubsan.la"
>>> +FILES_libsanitizer-staticdev = " \
>>> + ${libdir}/libasan.a \
>>> + ${libdir}/libubsan.a"
>>> +
>>> do_package_write_ipk[depends] +=
>>> "virtual/${MLPREFIX}libc:do_packagedata"
>>> do_package_write_deb[depends] +=
>>> "virtual/${MLPREFIX}libc:do_packagedata"
>>> do_package_write_rpm[depends] +=
>>> "virtual/${MLPREFIX}libc:do_packagedata"
>> I get the following error during do_install for gcc-runtime on Arch Linux
>> x86_64 host when it is linking libasan:
>> /usr/lib/libpthread.a: error adding symbols: File format not recognized
>>
> What machine are you building for? Or is this the SDK that's failing?
> This error looks like it's trying to link against the host's pthread library.
>
> I tested this on Fedora 20 x86_64.
I am building for ARMv7 device. I tested your v3 "gcc-runtime: enable
sanitizer" patch as well with the same result (bitbake gcc-runtime).
It is same issue as posted on opemembedded-devel some months ago:
http://permalink.gmane.org/gmane.comp.handhelds.openembedded/63689
When running do_install for gcc-runtime, it relinks libasan and has
-L/usr/lib in the command line when linking libasan.so because
libasan.la contains:
libdir='/usr/lib'.
The log.do_install file indicates:
warning: library search path "/usr/lib" is unsafe for cross-compilation
On your host system, do you have /usr/lib/libpthread.a?
Does your log.do_install indicate the that libasan.so is linked with
-L/usr/lib search path with "warning: library search path "/usr/lib" is
unsafe for cross-compilation"?
Regards,
Jonathan
next prev parent reply other threads:[~2014-09-04 15:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-29 21:15 [PATCH 2/5] gcc-runtime: enable asan and tsan Dan McGregor
2014-08-29 21:20 ` Dan McGregor
2014-09-04 14:33 ` Jonathan Liu
2014-09-04 15:28 ` Dan McGregor
2014-09-04 15:37 ` Jonathan Liu [this message]
2014-09-04 20:49 ` Dan McGregor
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=54088743.1010604@gmail.com \
--to=net147@gmail.com \
--cc=danismostlikely@gmail.com \
--cc=openembedded-core@lists.openembedded.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