Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 2/5] gcc-runtime: enable asan and tsan
@ 2014-08-29 21:15 Dan McGregor
  2014-08-29 21:20 ` Dan McGregor
  2014-09-04 14:33 ` Jonathan Liu
  0 siblings, 2 replies; 6+ messages in thread
From: Dan McGregor @ 2014-08-29 21:15 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

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"
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/5] gcc-runtime: enable asan and tsan
  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
  1 sibling, 0 replies; 6+ messages in thread
From: Dan McGregor @ 2014-08-29 21:20 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On 29 August 2014 15:15, Dan McGregor <danismostlikely@gmail.com> 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"
> --
> 1.9.3


Gah. It works for x86_64 too, so RUNTTIMETARGET there should also have
libsanitizer


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/5] gcc-runtime: enable asan and tsan
  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
  1 sibling, 1 reply; 6+ messages in thread
From: Jonathan Liu @ 2014-09-04 14:33 UTC (permalink / raw)
  To: Dan McGregor, Patches and discussions about the oe-core layer

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

Regards,
Jonathan


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/5] gcc-runtime: enable asan and tsan
  2014-09-04 14:33 ` Jonathan Liu
@ 2014-09-04 15:28   ` Dan McGregor
  2014-09-04 15:37     ` Jonathan Liu
  0 siblings, 1 reply; 6+ messages in thread
From: Dan McGregor @ 2014-09-04 15:28 UTC (permalink / raw)
  To: Jonathan Liu; +Cc: Patches and discussions about the oe-core layer

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.

> Regards,
> Jonathan


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/5] gcc-runtime: enable asan and tsan
  2014-09-04 15:28   ` Dan McGregor
@ 2014-09-04 15:37     ` Jonathan Liu
  2014-09-04 20:49       ` Dan McGregor
  0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Liu @ 2014-09-04 15:37 UTC (permalink / raw)
  To: Dan McGregor; +Cc: Patches and discussions about the oe-core layer

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/5] gcc-runtime: enable asan and tsan
  2014-09-04 15:37     ` Jonathan Liu
@ 2014-09-04 20:49       ` Dan McGregor
  0 siblings, 0 replies; 6+ messages in thread
From: Dan McGregor @ 2014-09-04 20:49 UTC (permalink / raw)
  To: Jonathan Liu; +Cc: Patches and discussions about the oe-core layer

On 4 September 2014 09:37, Jonathan Liu <net147@gmail.com> wrote:
> 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"?
>

I'm not getting the QA warning. I'm not sure why; in my logs I'm
seeing that it's trying to use /usr/lib,
but ld continues on its merry way after it finds the real library in
the sysroot. I'm noting two problems with my change:

1) gcc-runtime now depends on glibc being in the sysroot

and

2) libsanitizer insists on using adding -L/usr/lib to the link
command. It seems to be because it uses libstc++'s .la file that was
just built AND the one installed already.
I wonder what happens if libsanitizer gets installed before libstdc++.

> Regards,
> Jonathan


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-09-04 20:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2014-09-04 20:49       ` Dan McGregor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox