New issue
Advanced search Search tips

Issue 778063 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Oct 2017
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

Fix -float-abi flag in clang armv7 command line

Project Member Reported by manojgupta@chromium.org, Oct 25 2017

Issue description

Currently wrapper adds -float-abi=hard to clang command line in the end. This creates confusion because if any user passes -float-abi=X, then clang will get the floabi-abi value as hard instead of X. This is a miscompilation from user POV.

 $ armv7a-cros-linux-gnueabi-clang -mfloat-abi=soft -print-cmdline
[/usr/bin/ccache] ccache /usr/bin/clang --sysroot=/usr/armv7a-cros-linux-gnueabi -Qunused-arguments -grecord-gcc-switches -fstack-protector-strong -pie -fPIE -D_FORTIFY_SOURCE=2 -mthumb -mfloat-abi=soft -B/usr/libexec/gcc/armv7a-cros-linux-gnueabi -target armv7a-cros-linux-gnueabi -mfloat-abi=hard
 

Comment 1 by vapier@chromium.org, Oct 25 2017

just so there's no confusion, -mfloat-abi=soft usage with our toolchains will only work for completely standalone code like bootloaders and kernels, and even then some projects (like u-boot) sometimes want to link in libgcc.a which will fail.  we only ship hardfloat libs.

i agree we should fix the wrapper behavior regardless :).
Project Member

Comment 2 by bugdroid1@chromium.org, Oct 25 2017

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

commit 56313dd779e672c260e1ef0110a07f919475343f
Author: Manoj Gupta <manojgupta@google.com>
Date: Wed Oct 25 05:09:06 2017

wrapper: Insert -mfloat-abi=hard in beginning of clang command line.

Inserting -mfloat-abi=hard in end results in a miscompilation
from user POV if -mfloat-abi=X is passed since X is ignored.
So, add this to beginning of clang cmd line in wrapper instead.

BUG= chromium:778063 
TEST="-mfloat-abi=hard" is in beginning of clang command line.

Change-Id: Ib0163f258cd28ba00045145268517d473621df17
Reviewed-on: https://chromium-review.googlesource.com/736714
Commit-Queue: Manoj Gupta <manojgupta@chromium.org>
Tested-by: Manoj Gupta <manojgupta@chromium.org>
Trybot-Ready: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/56313dd779e672c260e1ef0110a07f919475343f/sys-devel/gcc/files/sysroot_wrapper.hardened.body
[rename] https://crrev.com/56313dd779e672c260e1ef0110a07f919475343f/sys-devel/llvm/llvm-5.0_pre305632_p20170806-r10.ebuild
[rename] https://crrev.com/56313dd779e672c260e1ef0110a07f919475343f/sys-devel/gcc/gcc-4.9.2-r169.ebuild

Status: Verified (was: Untriaged)

Sign in to add a comment