New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 625067 link

Starred by 2 users

Issue metadata

Status: Verified
Owner:
Last visit > 30 days ago
Closed: Jul 2016
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug

Blocking:
issue 537368



Sign in to add a comment

llvm: review list of clang unsupported flags in the sysroot_wrapper.hardened

Project Member Reported by llozano@chromium.org, Jul 1 2016

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',
  }

 
Project Member

Comment 1 by bugdroid1@chromium.org, Jul 9 2016

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

commit fa07ca01e23e6f3f560d3070405f782a26b174f3
Author: Luis Lozano <llozano@chromium.org>
Date: Thu Jul 07 08:19:09 2016

sysroot_wrapper: Wunused-local-typedefs is now supported by clang.

This flag is now supported by clang. Need to update the wrapper
to avoid removing it when the user has specified it.

BUG= chromium:625067 
TEST=Built Simple Chrome with GN and Clang compiler by default.

Change-Id: Ie311c3f871ba642ee984e6be3fd2c4e2c370c343
Reviewed-on: https://chromium-review.googlesource.com/358770
Commit-Ready: Luis Lozano <llozano@chromium.org>
Tested-by: Luis Lozano <llozano@chromium.org>
Reviewed-by: Steven Bennetts <stevenjb@chromium.org>
Reviewed-by: Rahul Chaudhry <rahulchaudhry@chromium.org>

[modify] https://crrev.com/fa07ca01e23e6f3f560d3070405f782a26b174f3/sys-devel/gcc/files/sysroot_wrapper.hardened
[rename] https://crrev.com/fa07ca01e23e6f3f560d3070405f782a26b174f3/sys-devel/gcc/gcc-4.9.2-r130.ebuild

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.

Project Member

Comment 3 by bugdroid1@chromium.org, 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

Status: Fixed (was: Assigned)
Blocking: 537368
Labels: VerifyIn-54
Status: Verified (was: Fixed)
bulk verified

Sign in to add a comment