New issue
Advanced search Search tips

Issue 710934 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Apr 2017
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

emerge valgrind fails on x86 boards: clang: unknown argument: '-mpreferred-stack-boundary=2'

Project Member Reported by norvez@chromium.org, Apr 12 2017

Issue description


Compilation of valgrind-3.10.1 fails on 32-bit boards (x86_64 works fine).

$ equery-x86-generic w valgrind
/mnt/host/source/src/third_party/portage-stable/dev-util/valgrind/valgrind-3.10.1.ebuild
$
$ emerge-x86-generic valgrind
<...>
i686-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I..  -I.. -I../include -I../VEX/pub -I../VEX/pub -DVGA_x86=1 -DVGO_linux=1 -DVGP_x86_linux=1 -DVGPV_x86_linux_vanilla=1 -Ipriv  -m32 -mpreferred-stack-boundary=2 -fno-stack-protector -O2 -g -Wall -Wmissing-prototypes -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wno-format-zero-length -fno-strict-aliasing -fno-builtin -fomit-frame-pointer -Wbad-function-cast -Wcast-qual -Wcast-align -fstrict-aliasing -Wno-long-long -O2 -march=i686 -pipe -O2 -pipe -march=i686 -mfpmath=sse -mmmx -msse -msse2 -msse3 -g -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -clang-syntax -fno-stack-protector -c -o priv/libvex_x86_linux_a-host_mips_defs.o `test -f 'priv/host_mips_defs.c' || echo './'`priv/host_mips_defs.c
i686-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I..  -I.. -I../include -I../VEX/pub -I../VEX/pub -DVGA_x86=1 -DVGO_linux=1 -DVGP_x86_linux=1 -DVGPV_x86_linux_vanilla=1 -Ipriv  -m32 -mpreferred-stack-boundary=2 -fno-stack-protector -O2 -g -Wall -Wmissing-prototypes -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wno-format-zero-length -fno-strict-aliasing -fno-builtin -fomit-frame-pointer -Wbad-function-cast -Wcast-qual -Wcast-align -fstrict-aliasing -Wno-long-long -O2 -march=i686 -pipe -O2 -pipe -march=i686 -mfpmath=sse -mmmx -msse -msse2 -msse3 -g -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -clang-syntax -fno-stack-protector -c -o priv/libvex_x86_linux_a-host_mips_isel.o `test -f 'priv/host_mips_isel.c' || echo './'`priv/host_mips_isel.
clang-4.0: error: unknown argument: '-mpreferred-stack-boundary=2'
clang-4.0: error: unknown argument: '-mpreferred-stack-boundary=2'
clang-4.0: error: unknown argument: '-mpreferred-stack-boundary=2'
clang-4.0clang-4.0: : error: unknown argument: '-mpreferred-stack-boundary=2'
error: unknown argument: '-mpreferred-stack-boundary=2'
clang-4.0: error: unknown argument: '-mpreferred-stack-boundary=2'
clang-4.0: error: unknown argument: '-mpreferred-stack-boundary=2'
clang-4.0: error: unknown argument: '-mpreferred-stack-boundary=2'
clang-4.0: error: unknown argument: '-mpreferred-stack-boundary=2'
clang-4.0clang-4.0: : errorerror: : unknown argument: '-mpreferred-stack-boundary=2'unknown argument: '-mpreferred-stack-boundary=2'

clang-4.0: error: unknown argument: '-mpreferred-stack-boundary=2'
clang-4.0: error: unknown argument: '-mpreferred-stack-boundary=2'
clang-4.0: error: unknown argument: '-mpreferred-stack-boundary=2'
clang-4.0: error: unknown argument: '-mpreferred-stack-boundary=2'
clang-4.0: error: unknown argument: '-mpreferred-stack-boundary=2'
clang-4.0: error: unknown argument: '-mpreferred-stack-boundary=2'
clang-4.0: error: unknown argument: '-mpreferred-stack-boundary=2'
clang-4.0: error: unknown argument: '-mpreferred-stack-boundary=2'clang-4.0: 
error: unknown argument: '-mpreferred-stack-boundary=2'
clang-4.0: error: unknown argument: '-mpreferred-stack-boundary=2'
clang-4.0: error: unknown argument: '-mpreferred-stack-boundary=2'
clang-4.0: error: unknown argument: '-mpreferred-stack-boundary=2'clang-4.0: error: unknown argument: '-mpreferred-stack-boundary=2'
clang-4.0: error: unknown argument: '-mpreferred-stack-boundary=2'

clang-4.0: error: unknown argument: '-mpreferred-stack-boundary=2'
clang-4.0: error: unknown argument: '-mpreferred-stack-boundary=2'
clang-4.0: error: unknown argument: '-mpreferred-stack-boundary=2'
clang-4.0: error: clang-4.0: unknown argument: '-mpreferred-stack-boundary=2'error: 
unknown argument: '-mpreferred-stack-boundary=2'
clang-4.0: error: unknown argument: '-mpreferred-stack-boundary=2'
clang-4.0: error: clang-4.0: unknown argument: '-mpreferred-stack-boundary=2'error: 
unknown argument: '-mpreferred-stack-boundary=2'
clang-4.0: error: unknown argument: '-mpreferred-stack-boundary=2'
clang-4.0: error: unknown argument: '-mpreferred-stack-boundary=2'
clang-4.0: error: unknown argument: '-mpreferred-stack-boundary=2'
clang-4.0: error: unknown argument: '-mpreferred-stack-boundary=2'
clang-4.0: error: unknown argument: '-mpreferred-stack-boundary=2'
clang-4.0: error: unknown argument: '-mpreferred-stack-boundary=2'
make[3]: *** [Makefile:1230: priv/libvex_x86_linux_a-ir_opt.o] Error 1
make[3]: *** Waiting for unfinished jobs....
clang-4.0: error: unknown argument: '-mpreferred-stack-boundary=2'
make[3]: *** [Makefile:1174: priv/libvex_x86_linux_a-main_util.o] Error 1
clang-4.0: error: unknown argument: '-mpreferred-stack-boundary=2'
make[3]: *** [Makefile:1146: priv/libvex_x86_linux_a-main_globals.o] Error 1
make[3]: *** [Makefile:1202: priv/libvex_x86_linux_a-ir_inject.o] Error 1
clang-4.0: error: unknown argument: '-mpreferred-stack-boundary=2'
make[3]: *** [Makefile:1188: priv/libvex_x86_linux_a-ir_defs.o] Error 1
clang-4.0: clang-4.0: error: errorunknown argument: '-mpreferred-stack-boundary=2': 
unknown argument: '-mpreferred-stack-boundary=2'
make[3]: *** [Makefile:1328: priv/libvex_x86_linux_a-guest_ppc_helpers.o] Error 1
make[3]: *** [Makefile:1300: priv/libvex_x86_linux_a-guest_amd64_helpers.o] Error 1
make[3]: *** [Makefile:1244: priv/libvex_x86_linux_a-guest_generic_bb_to_IR.o] Error 1
make[3]: *** [Makefile:1314: priv/libvex_x86_linux_a-guest_amd64_toIR.o] Error 1
make[3]: *** [Makefile:1496: priv/libvex_x86_linux_a-host_generic_simd128.o] Error 1
make[3]: *** [Makefile:1272: priv/libvex_x86_linux_a-guest_x86_helpers.o] Error 1
make[3]: *** [Makefile:1482: priv/libvex_x86_linux_a-host_generic_simd64.o] Error 1
make[3]: *** [Makefile:1636: priv/libvex_x86_linux_a-host_arm_defs.o] Error 1
make[3]: *** [Makefile:1216: priv/libvex_x86_linux_a-ir_match.o] Error 1
make[3]: *** [Makefile:1440: priv/libvex_x86_linux_a-guest_mips_helpers.o] Error 1
make[3]: *** [Makefile:1342: priv/libvex_x86_linux_a-guest_ppc_toIR.o] Error 1
make[3]: *** [Makefile:1258: priv/libvex_x86_linux_a-guest_generic_x87.o] Error 1
make[3]: *** [Makefile:1454: priv/libvex_x86_linux_a-guest_mips_toIR.o] Error 1
make[3]: *** [Makefile:1160: priv/libvex_x86_linux_a-main_main.o] Error 1
make[3]: *** [Makefile:1748: priv/libvex_x86_linux_a-host_mips_isel.o] Error 1
make[3]: *** [Makefile:1286: priv/libvex_x86_linux_a-guest_x86_toIR.o] Error 1
make[3]: *** [Makefile:1398: priv/libvex_x86_linux_a-guest_arm64_toIR.o] Error 1
make[3]: *** [Makefile:1356: priv/libvex_x86_linux_a-guest_arm_helpers.o] Error 1
make[3]: *** [Makefile:1720: priv/libvex_x86_linux_a-s390_disasm.o] Error 1
make[3]: *** [Makefile:1664: priv/libvex_x86_linux_a-host_arm64_defs.o] Error 1
make[3]: *** [Makefile:1594: priv/libvex_x86_linux_a-host_amd64_isel.o] Error 1
make[3]: *** [Makefile:1412: priv/libvex_x86_linux_a-guest_s390_helpers.o] Error 1
make[3]: *** [Makefile:1734: priv/libvex_x86_linux_a-host_mips_defs.o] Error 1
make[3]: *** [Makefile:1538: priv/libvex_x86_linux_a-host_generic_reg_alloc2.o] Error 1
make[3]: *** [Makefile:1426: priv/libvex_x86_linux_a-guest_s390_toIR.o] Error 1
make[3]: *** [Makefile:1524: priv/libvex_x86_linux_a-host_generic_maddf.o] Error 1
make[3]: *** [Makefile:1510: priv/libvex_x86_linux_a-host_generic_simd256.o] Error 1
make[3]: *** [Makefile:1580: priv/libvex_x86_linux_a-host_amd64_defs.o] Error 1
make[3]: *** [Makefile:1622: priv/libvex_x86_linux_a-host_ppc_isel.o] Error 1
make[3]: *** [Makefile:1706: priv/libvex_x86_linux_a-host_s390_isel.o] Error 1
make[3]: *** [Makefile:1370: priv/libvex_x86_linux_a-guest_arm_toIR.o] Error 1
make[3]: *** [Makefile:1468: priv/libvex_x86_linux_a-host_generic_regs.o] Error 1
make[3]: *** [Makefile:1552: priv/libvex_x86_linux_a-host_x86_defs.o] Error 1
make[3]: *** [Makefile:1678: priv/libvex_x86_linux_a-host_arm64_isel.o] Error 1
make[3]: *** [Makefile:1608: priv/libvex_x86_linux_a-host_ppc_defs.o] Error 1
make[3]: *** [Makefile:1384: priv/libvex_x86_linux_a-guest_arm64_helpers.o] Error 1
make[3]: *** [Makefile:1566: priv/libvex_x86_linux_a-host_x86_isel.o] Error 1
make[3]: *** [Makefile:1692: priv/libvex_x86_linux_a-host_s390_defs.o] Error 1
make[3]: *** [Makefile:1650: priv/libvex_x86_linux_a-host_arm_isel.o] Error 1
make[3]: Leaving directory '/build/x86-generic/tmp/portage/dev-util/valgrind-3.10.1/work/valgrind-3.10.1/VEX'
make[2]: *** [Makefile:770: all] Error 2
make[2]: Leaving directory '/build/x86-generic/tmp/portage/dev-util/valgrind-3.10.1/work/valgrind-3.10.1/VEX'
make[1]: *** [Makefile:772: all-recursive] Error 1
make[1]: Leaving directory '/build/x86-generic/tmp/portage/dev-util/valgrind-3.10.1/work/valgrind-3.10.1'
make: *** [Makefile:640: all] Error 2
 * ERROR: dev-util/valgrind-3.10.1::portage-stable failed (compile phase):
 *   emake failed

 

Comment 1 by vapier@chromium.org, Apr 12 2017

i'm not sure how much we'll care about this since we're sunsetting x86 in general
If we want to fix it - The easiest solution is to filter clang-syntax for valgrind package.

Comment 3 by cmt...@chromium.org, Apr 12 2017

What happens when we try to emerge valgrind on other boards, which use clang as the default compiler?

-mpreferred-stack-boundary=2 is not supported by clang, you can force to use gcc to build it via some change like https://chromium-review.googlesource.com/c/324750/

Comment 5 by cmt...@chromium.org, Apr 12 2017

Maybe we should look for and remove that flag for all clang invocations (in the compiler wrapper).

Comment 6 by vapier@chromium.org, Apr 12 2017

imo, having the compiler wrapper silently strip flags is bad and we should be doing it only as a last resort

we can send a patch to the valgrind project so that it tests for the validity of the flag before using it, or we can disable clang usage for x86 only

Comment 7 by cmt...@chromium.org, Apr 12 2017

Owner: cmt...@chromium.org
Status: Assigned (was: Unconfirmed)
Valgrind already checks the validity of flags, it just doesn't realize we're calling clang for syntax checking in this case, so it only tests GCC.

I'll update the package to filter out clang syntax checking.
Project Member

Comment 8 by bugdroid1@chromium.org, Apr 13 2017

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

commit e41f403096c3d186f28edaf58498d0c18d3d0f7c
Author: Caroline Tice <cmtice@google.com>
Date: Thu Apr 13 03:25:30 2017

Remove clang syntax checking from valgrind package.

When building with GCC, valgrind uses -mpreferred-stack-boundary=2
which clang does not recognize, so the clang syntax checker fails,
causing the build to fail.  (Not an issue if building directly with
clang, as valgrind checks to see if the main compiler recognizes the
flag or not).

This CL removes clang syntax checking for the valgrind package.

BUG= chromium:710934 
TEST=emerge-x86-alex valgrind failed without this change, but passes
with this change.

Change-Id: I14650a112e58042aa6e3f2ed8ec558b302c07f1c
Reviewed-on: https://chromium-review.googlesource.com/475977
Commit-Ready: Caroline Tice <cmtice@chromium.org>
Tested-by: Caroline Tice <cmtice@chromium.org>
Reviewed-by: Yunlian Jiang <yunlian@chromium.org>

[add] https://crrev.com/e41f403096c3d186f28edaf58498d0c18d3d0f7c/chromeos/config/env/dev-util/valgrind

Comment 9 by cmt...@chromium.org, Apr 14 2017

Status: Fixed (was: Assigned)

Comment 10 by dchan@google.com, May 30 2017

Labels: VerifyIn-60
Labels: VerifyIn-61
Status: Verified (was: Fixed)
Closing. Please reopen it if its not fixed. Thanks!

Sign in to add a comment