All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] gcc-sanitizers: Fix libtool library files
@ 2016-09-20  9:19 Yuanjie Huang
  2016-09-20 13:35 ` Burton, Ross
  2016-09-20 20:48 ` Khem Raj
  0 siblings, 2 replies; 7+ messages in thread
From: Yuanjie Huang @ 2016-09-20  9:19 UTC (permalink / raw)
  To: openembedded-core

From: Yuanjie Huang <yuanjie.huang@windriver.com>

Since libtool sysroot is not set when compiling sanitizers, the libtool
does no prefix the dependency path correctly. Fix it, so that programs
can link to sanitizer libraries without error.

This patch changes the depenedency_libs line in libasan.la and
libusan.la from
	dependency_libs=' -lpthread -ldl '/usr/lib'/libstdc++.la '/usr/lib'/libstdc++.la'
to
	dependency_libs=' -lpthread -ldl =/usr/lib/libstdc++.la =/usr/lib/libstdc++.la'

Upstream-Status: Inappropriate [embedded specific]
(LOCAL REV; NOT UPSTREAM) -- sent to oe-core on 2016-09-20

Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
---
 meta/recipes-devtools/gcc/gcc-sanitizers.inc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/recipes-devtools/gcc/gcc-sanitizers.inc b/meta/recipes-devtools/gcc/gcc-sanitizers.inc
index c987ccb..5fe5eaf 100644
--- a/meta/recipes-devtools/gcc/gcc-sanitizers.inc
+++ b/meta/recipes-devtools/gcc/gcc-sanitizers.inc
@@ -50,6 +50,8 @@ do_install () {
         rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
     fi
     chown -R root:root ${D}
+    # Fix broken libtool with stdc++, as sysroot is not set.
+    find ${D} -name \*.la -exec sed -i "/^dependency_libs=/s@'/usr/lib'@=/usr/lib@g" {} \;
 }
 
 INHIBIT_DEFAULT_DEPS = "1"
-- 
1.9.1



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

* Re: [PATCH 1/1] gcc-sanitizers: Fix libtool library files
  2016-09-20  9:19 [PATCH 1/1] gcc-sanitizers: Fix libtool library files Yuanjie Huang
@ 2016-09-20 13:35 ` Burton, Ross
  2016-09-21  1:47   ` Yuanjie Huang
  2016-09-20 20:48 ` Khem Raj
  1 sibling, 1 reply; 7+ messages in thread
From: Burton, Ross @ 2016-09-20 13:35 UTC (permalink / raw)
  To: Yuanjie Huang; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 390 bytes --]

On 20 September 2016 at 10:19, Yuanjie Huang <Yuanjie.Huang@windriver.com>
wrote:

> Upstream-Status: Inappropriate [embedded specific]
> (LOCAL REV; NOT UPSTREAM) -- sent to oe-core on 2016-09-20
>

You don't need upstream-status tags in commit messages, only patches that
the recipe is applying.

Also please remove your internal tracking data from the commit message.

Ross

[-- Attachment #2: Type: text/html, Size: 866 bytes --]

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

* Re: [PATCH 1/1] gcc-sanitizers: Fix libtool library files
  2016-09-20  9:19 [PATCH 1/1] gcc-sanitizers: Fix libtool library files Yuanjie Huang
  2016-09-20 13:35 ` Burton, Ross
@ 2016-09-20 20:48 ` Khem Raj
  2016-09-21  1:46   ` Yuanjie Huang
  1 sibling, 1 reply; 7+ messages in thread
From: Khem Raj @ 2016-09-20 20:48 UTC (permalink / raw)
  To: Yuanjie Huang; +Cc: Patches and discussions about the oe-core layer

On Tue, Sep 20, 2016 at 2:19 AM, Yuanjie Huang
<Yuanjie.Huang@windriver.com> wrote:
> From: Yuanjie Huang <yuanjie.huang@windriver.com>
>
> Since libtool sysroot is not set when compiling sanitizers, the libtool
> does no prefix the dependency path correctly. Fix it, so that programs
> can link to sanitizer libraries without error.
>
> This patch changes the depenedency_libs line in libasan.la and
> libusan.la from
>         dependency_libs=' -lpthread -ldl '/usr/lib'/libstdc++.la '/usr/lib'/libstdc++.la'
> to
>         dependency_libs=' -lpthread -ldl =/usr/lib/libstdc++.la =/usr/lib/libstdc++.la'
>
> Upstream-Status: Inappropriate [embedded specific]
> (LOCAL REV; NOT UPSTREAM) -- sent to oe-core on 2016-09-20
>
> Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
> ---
>  meta/recipes-devtools/gcc/gcc-sanitizers.inc | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/meta/recipes-devtools/gcc/gcc-sanitizers.inc b/meta/recipes-devtools/gcc/gcc-sanitizers.inc
> index c987ccb..5fe5eaf 100644
> --- a/meta/recipes-devtools/gcc/gcc-sanitizers.inc
> +++ b/meta/recipes-devtools/gcc/gcc-sanitizers.inc
> @@ -50,6 +50,8 @@ do_install () {
>          rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
>      fi
>      chown -R root:root ${D}
> +    # Fix broken libtool with stdc++, as sysroot is not set.
> +    find ${D} -name \*.la -exec sed -i "/^dependency_libs=/s@'/usr/lib'@=/usr/lib@g" {} \;

what happens if you remove the .la files completely.

>  }
>
>  INHIBIT_DEFAULT_DEPS = "1"
> --
> 1.9.1
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


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

* Re: [PATCH 1/1] gcc-sanitizers: Fix libtool library files
  2016-09-20 20:48 ` Khem Raj
@ 2016-09-21  1:46   ` Yuanjie Huang
  2016-09-21  9:01     ` Burton, Ross
  0 siblings, 1 reply; 7+ messages in thread
From: Yuanjie Huang @ 2016-09-21  1:46 UTC (permalink / raw)
  To: Khem Raj; +Cc: Patches and discussions about the oe-core layer


On 09/21/2016 04:48 AM, Khem Raj wrote:
> On Tue, Sep 20, 2016 at 2:19 AM, Yuanjie Huang
> <Yuanjie.Huang@windriver.com> wrote:
>> From: Yuanjie Huang <yuanjie.huang@windriver.com>
>>
>> Since libtool sysroot is not set when compiling sanitizers, the libtool
>> does no prefix the dependency path correctly. Fix it, so that programs
>> can link to sanitizer libraries without error.
>>
>> This patch changes the depenedency_libs line in libasan.la and
>> libusan.la from
>>          dependency_libs=' -lpthread -ldl '/usr/lib'/libstdc++.la '/usr/lib'/libstdc++.la'
>> to
>>          dependency_libs=' -lpthread -ldl =/usr/lib/libstdc++.la =/usr/lib/libstdc++.la'
>>
>> Upstream-Status: Inappropriate [embedded specific]
>> (LOCAL REV; NOT UPSTREAM) -- sent to oe-core on 2016-09-20
>>
>> Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
>> ---
>>   meta/recipes-devtools/gcc/gcc-sanitizers.inc | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/meta/recipes-devtools/gcc/gcc-sanitizers.inc b/meta/recipes-devtools/gcc/gcc-sanitizers.inc
>> index c987ccb..5fe5eaf 100644
>> --- a/meta/recipes-devtools/gcc/gcc-sanitizers.inc
>> +++ b/meta/recipes-devtools/gcc/gcc-sanitizers.inc
>> @@ -50,6 +50,8 @@ do_install () {
>>           rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
>>       fi
>>       chown -R root:root ${D}
>> +    # Fix broken libtool with stdc++, as sysroot is not set.
>> +    find ${D} -name \*.la -exec sed -i "/^dependency_libs=/s@'/usr/lib'@=/usr/lib@g" {} \;
> what happens if you remove the .la files completely.
We have some user making use of these libraries directly, otherwise, 
cross gcc can link these sanitizer libraries with just -fsantizer flag 
without problem. Without .la files, his flow can not be libtoolized.

Best,
Yuanjie
>>   }
>>
>>   INHIBIT_DEFAULT_DEPS = "1"
>> --
>> 1.9.1
>>
>> --
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core



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

* Re: [PATCH 1/1] gcc-sanitizers: Fix libtool library files
  2016-09-20 13:35 ` Burton, Ross
@ 2016-09-21  1:47   ` Yuanjie Huang
  0 siblings, 0 replies; 7+ messages in thread
From: Yuanjie Huang @ 2016-09-21  1:47 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core


[-- Attachment #1.1: Type: text/plain, Size: 556 bytes --]

Thanks, commit message revised.

Best,
Yuanjie

On 09/20/2016 09:35 PM, Burton, Ross wrote:
>
> On 20 September 2016 at 10:19, Yuanjie Huang 
> <Yuanjie.Huang@windriver.com <mailto:Yuanjie.Huang@windriver.com>> wrote:
>
>     Upstream-Status: Inappropriate [embedded specific]
>     (LOCAL REV; NOT UPSTREAM) -- sent to oe-core on 2016-09-20
>
>
> You don't need upstream-status tags in commit messages, only patches 
> that the recipe is applying.
>
> Also please remove your internal tracking data from the commit message.
>
> Ross


[-- Attachment #1.2: Type: text/html, Size: 1790 bytes --]

[-- Attachment #2: 0001-gcc-sanitizers-Fix-libtool-library-files.patch --]
[-- Type: text/x-patch, Size: 1412 bytes --]

From 6ceafbc3a69a0b87bcddf718050c6958baab7759 Mon Sep 17 00:00:00 2001
From: Yuanjie Huang <yuanjie.huang@windriver.com>
Date: Sun, 18 Sep 2016 16:36:55 +0800
Subject: [PATCH V2] gcc-sanitizers: Fix libtool library files

Since libtool sysroot is not set when compiling sanitizers, the libtool
does no prefix the dependency path correctly. Fix it, so that programs
can link to sanitizer libraries without error.

This patch changes the depenedency_libs line in libasan.la and
libusan.la from
	dependency_libs=' -lpthread -ldl '/usr/lib'/libstdc++.la '/usr/lib'/libstdc++.la'
to
	dependency_libs=' -lpthread -ldl =/usr/lib/libstdc++.la =/usr/lib/libstdc++.la'

Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
---
 meta/recipes-devtools/gcc/gcc-sanitizers.inc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/recipes-devtools/gcc/gcc-sanitizers.inc b/meta/recipes-devtools/gcc/gcc-sanitizers.inc
index c987ccb..5fe5eaf 100644
--- a/meta/recipes-devtools/gcc/gcc-sanitizers.inc
+++ b/meta/recipes-devtools/gcc/gcc-sanitizers.inc
@@ -50,6 +50,8 @@ do_install () {
         rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
     fi
     chown -R root:root ${D}
+    # Fix broken libtool with stdc++, as sysroot is not set.
+    find ${D} -name \*.la -exec sed -i "/^dependency_libs=/s@'/usr/lib'@=/usr/lib@g" {} \;
 }
 
 INHIBIT_DEFAULT_DEPS = "1"
-- 
1.9.1


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

* Re: [PATCH 1/1] gcc-sanitizers: Fix libtool library files
  2016-09-21  1:46   ` Yuanjie Huang
@ 2016-09-21  9:01     ` Burton, Ross
  2016-10-09  1:43       ` Yuanjie Huang
  0 siblings, 1 reply; 7+ messages in thread
From: Burton, Ross @ 2016-09-21  9:01 UTC (permalink / raw)
  To: Yuanjie Huang; +Cc: Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 502 bytes --]

On 21 September 2016 at 02:46, Yuanjie Huang <yuanjie.huang@windriver.com>
wrote:

> We have some user making use of these libraries directly, otherwise, cross
> gcc can link these sanitizer libraries with just -fsantizer flag without
> problem. Without .la files, his flow can not be libtoolized.
>

libtool works fine without .la files on linux, which is why the
remove-libtool class works (which can be a distro-level inherit and deletes
every .la before it reaches the sysroot).

Ross

[-- Attachment #2: Type: text/html, Size: 907 bytes --]

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

* Re: [PATCH 1/1] gcc-sanitizers: Fix libtool library files
  2016-09-21  9:01     ` Burton, Ross
@ 2016-10-09  1:43       ` Yuanjie Huang
  0 siblings, 0 replies; 7+ messages in thread
From: Yuanjie Huang @ 2016-10-09  1:43 UTC (permalink / raw)
  To: Burton, Ross; +Cc: Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 836 bytes --]

Hi Ross,

Is it recommended practice to remove libtool .la files for oe-core when 
some issue pops? If yes, I would withdraw and prepare a new patch that 
complies with the practice.

Thanks,
Yuanjie

On 09/21/2016 05:01 PM, Burton, Ross wrote:
>
> On 21 September 2016 at 02:46, Yuanjie Huang 
> <yuanjie.huang@windriver.com <mailto:yuanjie.huang@windriver.com>> wrote:
>
>     We have some user making use of these libraries directly,
>     otherwise, cross gcc can link these sanitizer libraries with just
>     -fsantizer flag without problem. Without .la files, his flow can
>     not be libtoolized.
>
>
> libtool works fine without .la files on linux, which is why the 
> remove-libtool class works (which can be a distro-level inherit and 
> deletes every .la before it reaches the sysroot).
>
> Ross


[-- Attachment #2: Type: text/html, Size: 2015 bytes --]

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

end of thread, other threads:[~2016-10-09  1:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-20  9:19 [PATCH 1/1] gcc-sanitizers: Fix libtool library files Yuanjie Huang
2016-09-20 13:35 ` Burton, Ross
2016-09-21  1:47   ` Yuanjie Huang
2016-09-20 20:48 ` Khem Raj
2016-09-21  1:46   ` Yuanjie Huang
2016-09-21  9:01     ` Burton, Ross
2016-10-09  1:43       ` Yuanjie Huang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.