New issue
Advanced search Search tips

Issue 842316 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: May 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug
Build-Toolchain

Blocking:
issue 840995



Sign in to add a comment

libtool is filtering sanitizer flags when linking

Project Member Reported by manojgupta@chromium.org, May 11 2018

Issue description

libtool is dropping  the flags "-fsanizitie=*" when linking.

e.g. when building alsa-lib:

SYSROOT=/build/amd64-generic /bin/sh ../libtool  --tag=CC   --mode=link x86_64-cros-linux-gnu-clang  -fsanitize=address -fsanitize=fuzzer-no-link -O2 -pipe -march=x86-64 -msse3 -g -fno-exceptions -fno-unwind-tables   -fno-asynchronous-unwind-tables  -version-info 2:0:0 -Wl,--version-script=Versions  -Wl,--no-undefined -fsanitize=address -fsanitize=fuzzer-no-link -Wl,-O2 -Wl,--as-needed -o libasound.la -rpath /usr/lib64 conf.lo confmisc.lo input.lo output.lo async.lo error.lo dlmisc.lo socket.lo shmarea.lo userfile.lo names.lo control/libcontrol.la mixer/libmixer.la pcm/libpcm.la timer/libtimer.la rawmidi/librawmidi.la hwdep/libhwdep.la seq/libseq.la ucm/libucm.la topology/libtopology.la  -lm -ldl -lpthread -lrt -print-cmdline|& grep clang

libtool: link: x86_64-cros-linux-gnu-clang -shared  -fPIC -DPIC  .libs/conf.o .libs/confmisc.o .libs/input.o .libs/output.o .libs/async.o .libs/error.o .libs/dlmisc.o .libs/socket.o .libs/shmarea.o .libs/userfile.o .libs/names.o  -Wl,--whole-archive control/.libs/libcontrol.a mixer/.libs/libmixer.a pcm/.libs/libpcm.a timer/.libs/libtimer.a rawmidi/.libs/librawmidi.a hwdep/.libs/libhwdep.a seq/.libs/libseq.a ucm/.libs/libucm.a topology/.libs/libtopology.a -Wl,--no-whole-archive  -lm -ldl -lpthread -lrt  -O2 -march=x86-64 -msse3 -g -Wl,--version-script=Versions -Wl,--no-undefined -Wl,-O2 -Wl,--as-needed   -Wl,-soname -Wl,libasound.so.2 -o .libs/libasound.so.2.0.0

Note that libtool dropped the -fsanitize* flags
 
libtool also needs a newer sandbox but sandbox is not updated at libtool rebuild time.
https://ci.chromium.org/p/chromeos/builds/b8946788612505268544
Project Member

Comment 2 by bugdroid1@chromium.org, May 14 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosutils/+/63ee9f512be738d3c933c6bc33553cff2c747562

commit 63ee9f512be738d3c933c6bc33553cff2c747562
Author: Manoj Gupta <manojgupta@google.com>
Date: Mon May 14 22:32:48 2018

make_chroot: Install the build tools before toolchain updates.

libtool needs newer sandbox and is auto updated after GCC update.
Let's move the build of some important tools before the toolchain
update.

BUG= chromium:842316 
TEST=libtool builds in chromiumos-sdk.

Change-Id: I413953e1c9b8adc1f65df74e6feb36e4f6df651d
Reviewed-on: https://chromium-review.googlesource.com/1056037
Commit-Ready: Manoj Gupta <manojgupta@chromium.org>
Tested-by: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Caroline Tice <cmtice@chromium.org>
Reviewed-by: Benjamin Gordon <bmgordon@chromium.org>

[modify] https://crrev.com/63ee9f512be738d3c933c6bc33553cff2c747562/sdk_lib/make_chroot.sh

Project Member

Comment 3 by bugdroid1@chromium.org, May 14 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/portage-stable/+/c82e63a1ea9bcbe75800008e58b474994418c29a

commit c82e63a1ea9bcbe75800008e58b474994418c29a
Author: Manoj Gupta <manojgupta@google.com>
Date: Mon May 14 22:32:48 2018

libtool: Update to upstream 2.4.6-r5.

Update libtool to current gentoo upstream.

Changes:
1. EAPI -> 5
2. KEYWORDS -> *
3. Add epatch "${PATCHES[@]}" to apply the patches.
4. Continue applying the clang library detection patch.
5. Drop pthread patch since arc builds do not support -lpthread
   (see errors below).

https://ci.chromium.org/p/chromeos/builds/b8946782423288239488
arc-mesa-17.3.0_rc5-r123: /bin/sh ../../libtool  --tag=CXX   --mode=link
/opt/android-n/arc-llvm/3.8/bin/clang++
--gcc-toolchain=/opt/android-n/arc-gcc/x86_64/x86_64-linux-android-4.9 -target
x86_64-linux-android -m32
-I/build/reef/opt/google/containers/android/usr/include/arch-x86/include/ -fvisibility=hidden
-Werror=vla -O2 -pipe -O2 -pipe -O2 -pipe -march=corei7 -g -fno-exceptions -fno-unwind-tables
-fno-asynchronous-unwind-tables --sysroot=/build/reef/opt/google/containers/android
--gcc-toolchain=/opt/android-n/arc-gcc/x86_64/x86_64-linux-android-4.9 -target
x86_64-linux-android -stdlib=libc++
-I/build/reef/opt/google/containers/android/usr/include/c++/4.9 -Wall -fno-math-errno
-fno-trapping-math -Qunused-arguments   -Wl,-O1 -Wl,-O2 -Wl,--as-needed -o spirv2nir
spirv/spirv2nir-spirv2nir.o nir/libnir.la ../../src/util/libmesautil.la -lm -pthread
arc-mesa-17.3.0_rc5-r123: libtool: link: /opt/android-n/arc-llvm/3.8/bin/clang++
--gcc-toolchain=/opt/android-n/arc-gcc/x86_64/x86_64-linux-android-4.9 -target
x86_64-linux-android -m32
-I/build/reef/opt/google/containers/android/usr/include/arch-x86/include/ -fvisibility=hidden
-Werror=vla -O2 -pipe -O2 -pipe -O2 -pipe -march=corei7 -g -fno-exceptions -fno-unwind-tables
-fno-asynchronous-unwind-tables --sysroot=/build/reef/opt/google/containers/android
--gcc-toolchain=/opt/android-n/arc-gcc/x86_64/x86_64-linux-android-4.9 -target
x86_64-linux-android -stdlib=libc++
-I/build/reef/opt/google/containers/android/usr/include/c++/4.9 -Wall -fno-math-errno
-fno-trapping-math -Qunused-arguments -Wl,-O1 -Wl,-O2 -Wl,--as-needed -o spirv2nir
spirv/spirv2nir-spirv2nir.o -pthread  nir/.libs/libnir.a ../../src/util/.libs/libmesautil.a
-L/build/reef/opt/google/containers/android/usr/lib -lz -latomic -lm -lpthread -pthread
arc-mesa-17.3.0_rc5-r123:
/opt/android-n/arc-gcc/x86_64/x86_64-linux-android-4.9/lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/bin/ld:
error: cannot find -lpthread

CQ-DEPEND=CL:1056037

BUG= chromium:842316 
TEST=libtool builds
TEST=emerge-amd64-generic alsa-lib builds with sanitizer flags.

Change-Id: I4a51f2c9a5dfa587d86f4ba821925386da06f1c7
Reviewed-on: https://chromium-review.googlesource.com/1055882
Commit-Ready: Manoj Gupta <manojgupta@chromium.org>
Tested-by: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Yunlian Jiang <yunlian@chromium.org>

[add] https://crrev.com/c82e63a1ea9bcbe75800008e58b474994418c29a/sys-devel/libtool/files/libtool-2.4.6-sed-quote-speedup.patch
[delete] https://crrev.com/363adc8abf9e3aad962cbda0c7e60556f2aa614b/sys-devel/libtool/libtool-2.4.6-r1.ebuild
[add] https://crrev.com/c82e63a1ea9bcbe75800008e58b474994418c29a/sys-devel/libtool/libtool-2.4.6-r5.ebuild
[add] https://crrev.com/c82e63a1ea9bcbe75800008e58b474994418c29a/sys-devel/libtool/files/libtool-2.4.6-ppc64le.patch
[add] https://crrev.com/c82e63a1ea9bcbe75800008e58b474994418c29a/sys-devel/libtool/files/libtool-2.4.6-link-fsanitize.patch
[add] https://crrev.com/c82e63a1ea9bcbe75800008e58b474994418c29a/sys-devel/libtool/files/libtool-2.2.6a-darwin-module-bundle.patch
[add] https://crrev.com/c82e63a1ea9bcbe75800008e58b474994418c29a/sys-devel/libtool/files/libtool-2.4.6-mint.patch
[add] https://crrev.com/c82e63a1ea9bcbe75800008e58b474994418c29a/sys-devel/libtool/files/libtool-2.4.6-libtoolize-delay-help.patch
[add] https://crrev.com/c82e63a1ea9bcbe75800008e58b474994418c29a/sys-devel/libtool/files/libtool-2.4.6-libtoolize-slow.patch
[add] https://crrev.com/c82e63a1ea9bcbe75800008e58b474994418c29a/sys-devel/libtool/files/libtool-2.4.6-link-specs.patch
[add] https://crrev.com/c82e63a1ea9bcbe75800008e58b474994418c29a/sys-devel/libtool/files/libtool-2.4.6-link-fuse-ld.patch
[add] https://crrev.com/c82e63a1ea9bcbe75800008e58b474994418c29a/sys-devel/libtool/files/libtool-2.4.6-darwin-use-linux-version.patch

Status: Verified (was: Untriaged)
Project Member

Comment 5 by bugdroid1@chromium.org, Jun 5 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/8ad695d87337e3580a16efd2c1bd024d0c5680b8

commit 8ad695d87337e3580a16efd2c1bd024d0c5680b8
Author: Manoj Gupta <manojgupta@google.com>
Date: Tue Jun 05 18:46:33 2018

libtool: Move to chromiumos-overlay.

We have a few different patches when compared to upstream libtool ebuild.
So move it to chromiumos-overlay.

CQ-DEPEND=CL:1067845
BUG= chromium:842316 
TEST=libtool builds.

Change-Id: I0c9a659db68fad0ec036c8a39d544075042f372c
Reviewed-on: https://chromium-review.googlesource.com/1067844
Commit-Ready: Manoj Gupta <manojgupta@chromium.org>
Tested-by: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Caroline Tice <cmtice@chromium.org>

[add] https://crrev.com/8ad695d87337e3580a16efd2c1bd024d0c5680b8/sys-devel/libtool/files/libtool-2.4.6-sed-quote-speedup.patch
[add] https://crrev.com/8ad695d87337e3580a16efd2c1bd024d0c5680b8/sys-devel/libtool/metadata.xml
[add] https://crrev.com/8ad695d87337e3580a16efd2c1bd024d0c5680b8/sys-devel/libtool/files/libtool-2.4.6-ppc64le.patch
[add] https://crrev.com/8ad695d87337e3580a16efd2c1bd024d0c5680b8/sys-devel/libtool/files/libtool-2.4.3-use-linux-version-in-fbsd.patch
[add] https://crrev.com/8ad695d87337e3580a16efd2c1bd024d0c5680b8/sys-devel/libtool/libtool-2.4.6-r6.ebuild
[add] https://crrev.com/8ad695d87337e3580a16efd2c1bd024d0c5680b8/sys-devel/libtool/files/libtool-2.4.6-clang-libs.patch
[add] https://crrev.com/8ad695d87337e3580a16efd2c1bd024d0c5680b8/sys-devel/libtool/files/libtool-2.4.6-link-fsanitize.patch
[add] https://crrev.com/8ad695d87337e3580a16efd2c1bd024d0c5680b8/sys-devel/libtool/files/libtool-2.2.6a-darwin-module-bundle.patch
[add] https://crrev.com/8ad695d87337e3580a16efd2c1bd024d0c5680b8/sys-devel/libtool/files/libtool-2.4.6-mint.patch
[add] https://crrev.com/8ad695d87337e3580a16efd2c1bd024d0c5680b8/sys-devel/libtool/files/libtool-2.4.6-libtoolize-delay-help.patch
[add] https://crrev.com/8ad695d87337e3580a16efd2c1bd024d0c5680b8/sys-devel/libtool/files/libtool-2.4.6-libtoolize-slow.patch
[add] https://crrev.com/8ad695d87337e3580a16efd2c1bd024d0c5680b8/sys-devel/libtool/files/libtool-2.4.6-link-specs.patch
[add] https://crrev.com/8ad695d87337e3580a16efd2c1bd024d0c5680b8/sys-devel/libtool/files/libtool-2.4.6-link-fuse-ld.patch
[add] https://crrev.com/8ad695d87337e3580a16efd2c1bd024d0c5680b8/sys-devel/libtool/Manifest
[add] https://crrev.com/8ad695d87337e3580a16efd2c1bd024d0c5680b8/sys-devel/libtool/files/libtool-2.4.6-darwin-use-linux-version.patch

Project Member

Comment 6 by bugdroid1@chromium.org, Jun 5 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/portage-stable/+/4c51f9e99e9d3ea5b6499425d69ec536066505af

commit 4c51f9e99e9d3ea5b6499425d69ec536066505af
Author: Manoj Gupta <manojgupta@google.com>
Date: Tue Jun 05 18:46:32 2018

libtool: Remove from portage-stable

We have a few different patches when compared to upstream libtool ebuild.
So move it to chromiumos-overlay.

CQ-DEPEND=CL:1067844
BUG= chromium:842316 
TEST=libtool builds.

Change-Id: Idda6bf3997757a81f11c350bcc637be89d55e8d9
Reviewed-on: https://chromium-review.googlesource.com/1067845
Commit-Ready: Manoj Gupta <manojgupta@chromium.org>
Tested-by: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Caroline Tice <cmtice@chromium.org>

[delete] https://crrev.com/660bd9be698304f7d64f37022b940e1ed44c6da6/sys-devel/libtool/files/libtool-2.4.6-sed-quote-speedup.patch
[delete] https://crrev.com/660bd9be698304f7d64f37022b940e1ed44c6da6/sys-devel/libtool/metadata.xml
[delete] https://crrev.com/660bd9be698304f7d64f37022b940e1ed44c6da6/sys-devel/libtool/files/libtool-2.4.6-ppc64le.patch
[delete] https://crrev.com/660bd9be698304f7d64f37022b940e1ed44c6da6/sys-devel/libtool/files/libtool-2.4.3-use-linux-version-in-fbsd.patch
[delete] https://crrev.com/660bd9be698304f7d64f37022b940e1ed44c6da6/sys-devel/libtool/libtool-2.4.6-r5.ebuild
[delete] https://crrev.com/660bd9be698304f7d64f37022b940e1ed44c6da6/sys-devel/libtool/files/libtool-2.4.6-clang-libs.patch
[delete] https://crrev.com/660bd9be698304f7d64f37022b940e1ed44c6da6/sys-devel/libtool/files/libtool-2.4.6-link-fsanitize.patch
[delete] https://crrev.com/660bd9be698304f7d64f37022b940e1ed44c6da6/sys-devel/libtool/files/libtool-2.2.6a-darwin-module-bundle.patch
[delete] https://crrev.com/660bd9be698304f7d64f37022b940e1ed44c6da6/sys-devel/libtool/files/libtool-2.4.6-mint.patch
[delete] https://crrev.com/660bd9be698304f7d64f37022b940e1ed44c6da6/sys-devel/libtool/files/libtool-2.4.6-libtoolize-delay-help.patch
[delete] https://crrev.com/660bd9be698304f7d64f37022b940e1ed44c6da6/sys-devel/libtool/files/libtool-2.4.6-libtoolize-slow.patch
[delete] https://crrev.com/660bd9be698304f7d64f37022b940e1ed44c6da6/sys-devel/libtool/files/libtool-2.4.6-link-specs.patch
[delete] https://crrev.com/660bd9be698304f7d64f37022b940e1ed44c6da6/sys-devel/libtool/files/libtool-2.4.6-link-fuse-ld.patch
[delete] https://crrev.com/660bd9be698304f7d64f37022b940e1ed44c6da6/sys-devel/libtool/Manifest
[delete] https://crrev.com/660bd9be698304f7d64f37022b940e1ed44c6da6/sys-devel/libtool/files/libtool-2.4.6-darwin-use-linux-version.patch

Sign in to add a comment