llvm: review list of clang unsupported flags in the sysroot_wrapper.hardened |
|||||
Issue description
sysroot_wrapper contains code like this to handle gcc to clang flags.
However, I have found that some of these are out-of-date. We need to verify this before the transition.
(Please see the latest code in sysroot_wrapper. what is copied below is not the latest)
# Gcc flags to remove from the clang command line.
# TODO: Once clang supports gcc compatibility mode, remove
# these checks.
#
# Use of -Qunused-arguments allows this set to be small, just those
# that clang still warns about.
clang_unsupported = set(['-pass-exit-codes', '-Ofast', '-Wclobbered',
'-Wunsafe-loop-optimizations', '-Wlogical-op',
'-Wmissing-parameter-type', '-Woverride-init',
'-Wold-style-declaration', '-Wno-psabi',
'-mno-movbe',
])
clang_unsupported_prefixes = ('-Wstrict-aliasing=', '-finline-limit=')
# clang with '-ftrapv' generates 'call __mulodi4', which is only implemented
# in compiler-rt library. However compiler-rt library only has i386/x86_64
# backends (see '/usr/lib/clang/3.7.0/lib/linux/libclang_rt.*'). Gcc, on the
# other hand, generate 'call __mulvdi3', which is implemented in libgcc. See
# bug chromium:503229 .
clang_arm_options_to_be_discarded = set(['-ftrapv'])
# Clang may use different options for the same or similar functionality.
gcc_to_clang = {
'-Wno-error=unused-but-set-variable': '-Wno-error=unused-variable',
'-Wno-error=maybe-uninitialized': '-Wno-error=uninitialized',
'-Wno-unused-but-set-variable': '-Wno-unused-variable',
'-Wunused-but-set-variable': '-Wunused-variable',
'-fstack-protector-strong': '-fstack-protector-all',
'-fvisibility=internal': '-fvisibility=hidden',
'-Wno-error=cpp': '-Wno-#warnings',
}
,
Jul 28 2016
I have tried all the flags in clang_unsupported and clang_unsupported_prefixes sets. As of this week, all of them are still unsupported with one exception. -Ofast is now supported by clang. According to http://clang.llvm.org/docs/CommandGuide/clang.html#cmdoption-Ofast: "-Ofast Enables all the optimizations from -O3 along with other aggressive optimizations that may violate strict compliance with language standards." https://chromium-review.googlesource.com/#/c/364233 removes -Ofast from the unsupported set.
,
Jul 29 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/ca5009b85955e472ee88e26e8e36d86143736cfa commit ca5009b85955e472ee88e26e8e36d86143736cfa Author: Rahul Chaudhry <rahulchaudhry@chromium.org> Date: Wed Jul 27 20:20:54 2016 sys-devel/gcc: remove '-Ofast' from the clang unsupported flags list. '-Ofast' is now supported by clang. Updated sysroot_wrapper so that flag '-Ofast' is not removed before invoking clang. BUG= chromium:625067 TEST='setup_board --profile=llvm --nousepkg --board=panther' TEST='build_packages --nousepkg --board=panther' TEST='flashed panther device with llvm built image; boots fine' TEST='setup_board --profile=llvm --nousepkg --board=x86-zgb' TEST='build_packages --nousepkg --board=x86-zgb' TEST='flashed x86-zgb device with llvm built image; boots fine' TEST='Successfully built chrome for panther (simple-chrome).' TEST='Successfully built chrome for x86-zgb (simple-chrome).' TEST='Successfully built chrome for daisy (simple-chrome).' Change-Id: Icd508399ca7eb13fe4416cff1909f9d5d68b1f71 Reviewed-on: https://chromium-review.googlesource.com/364233 Commit-Ready: Rahul Chaudhry <rahulchaudhry@chromium.org> Tested-by: Rahul Chaudhry <rahulchaudhry@chromium.org> Reviewed-by: Caroline Tice <cmtice@chromium.org> [modify] https://crrev.com/ca5009b85955e472ee88e26e8e36d86143736cfa/sys-devel/gcc/files/sysroot_wrapper.hardened [rename] https://crrev.com/ca5009b85955e472ee88e26e8e36d86143736cfa/sys-devel/gcc/gcc-4.9.2-r132.ebuild
,
Jul 29 2016
,
Aug 19 2016
,
Aug 29 2016
,
Aug 29 2016
bulk verified |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by bugdroid1@chromium.org
, Jul 9 2016