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

Issue 632387 link

Starred by 3 users

Issue metadata

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

Blocking:
issue 537368



Sign in to add a comment

chell board fails in BuildPackages when built with LLVM.

Project Member Reported by cmt...@chromium.org, Jul 28 2016

Issue description

The chell board fails in BuildPackages when trying to build with LLVM.  In particular, it fails while building the sys-boot/coreboot package. See https://uberchromegw.corp.google.com/i/chromiumos.tryserver/builders/release/builds/5103  for details.
 

Comment 1 by cmt...@chromium.org, Jul 28 2016

Owner: laszio@chromium.org

Comment 2 by cmt...@chromium.org, Jul 28 2016

Status: Assigned (was: Untriaged)
Cc: vapier@chromium.org
 Issue 635147  has been merged into this issue.
coreboot is failing because chromes-mrc failed to produce FSP.fd. Why it failed but reporting success is another bug/story.

make -C GnuGenBootSector
make[1]: Entering directory '/build/chell/tmp/portage/sys-boot/chromeos-mrc-0.0.1-r209/work/chromeos-mrc-0.0.1/edk2/BaseTools/Source/C/GnuGenBootSector'
mkdir ../bin
x86_64-cros-linux-gnu-gcc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -nostdlib -c -g  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  GnuGenBootSector.c -o GnuGenBootSector.o
x86_64-cros-linux-gnu-gcc -o ../bin/GnuGenBootSector  GnuGenBootSector.o -L../libs -lCommon
/usr/x86_64-pc-linux-gnu/x86_64-cros-linux-gnu/binutils-bin/2.25.51/ld.gold.real: error: GnuGenBootSector.o: requires dynamic R_X86_64_32 reloc which may overflow at runtime; recompile with -fPIC
/usr/x86_64-pc-linux-gnu/x86_64-cros-linux-gnu/binutils-bin/2.25.51/ld.gold.real: error: ../libs/libCommon.a(CommonLib.o): requires dynamic R_X86_64_32 reloc which may overflow at runtime; recompile with -fPIC
/usr/x86_64-pc-linux-gnu/x86_64-cros-linux-gnu/binutils-bin/2.25.51/ld.gold.real: error: ../libs/libCommon.a(EfiUtilityMsgs.o): requires dynamic R_X86_64_32 reloc which may overflow at runtime; recompile with -fPIC
/usr/x86_64-pc-linux-gnu/x86_64-cros-linux-gnu/binutils-bin/2.25.51/ld.gold.real: error: ../libs/libCommon.a(ParseInf.o): requires dynamic R_X86_64_32 reloc which may overflow at runtime; recompile with -fPIC
collect2: error: ld returned 1 exit status
../Makefiles/app.makefile:24: recipe for target '../bin/GnuGenBootSector' failed
make[1]: *** [../bin/GnuGenBootSector] Error 1
 
GnuGenBootSector is a host tool which is supposed to be compiled by host cc. However, this CL calls cros_use_gcc (because clang doesn't work) which sets CC to target cc:
https://crrev.com/5c089b936d2e10aa8ea836bb01b046ba81cb38a7

The simplest way to fix it would be replacing "cros_use_gcc" by "unset CC CXX". Any objections?
host tools should be using a diff var than CC or CXX like BUILD_CC.  then the ebuild should be using `tc-export BUILD_CC` to set those up.  by unseting the vars, you're now breaking the target build too by letting it use the native compiler instead of the cross-compiler.
This CL was tested before being uploaded. The default 'base' profile doesn't set CC nor CXX. Unsetting them should only revert what's done in the 'llvm' profile and shouldn't break anything [1].

In fact, the package in question doesn't produce target executables nor libraries. I'm surprised that cros_use_gcc could satisfy the build tests.

[1] By the way, this might be a good example not to complicate CFLAGS in build profiles' make.conf, since host tools and target executables may require different flags.

Comment 7 by vapier@chromium.org, Aug 10 2016

because it "happens" to "work" by default does not make it correct or right.  using the target CC to build tools that run on the host is *never* correct.

there is a similar separation between build flags -- use BUILD_CFLAGS and BUILD_CPPFLAGS and BUILD_LDFLAGS and such rather than CFLAGS/etc...
Blocking: 537368
Project Member

Comment 9 by bugdroid1@chromium.org, Sep 9 2016

Project Member

Comment 10 by bugdroid1@chromium.org, Sep 9 2016

Project Member

Comment 11 by bugdroid1@chromium.org, Sep 9 2016

Project Member

Comment 12 by bugdroid1@chromium.org, Sep 9 2016

Project Member

Comment 13 by bugdroid1@chromium.org, Sep 9 2016

Project Member

Comment 14 by bugdroid1@chromium.org, Sep 9 2016

Project Member

Comment 15 by bugdroid1@chromium.org, Sep 9 2016

Status: Fixed (was: Assigned)
Status: Verified (was: Fixed)
Project Member

Comment 18 by bugdroid1@chromium.org, Sep 9 2016

The following revision refers to this bug:
  https://chrome-internal.googlesource.com/chromeos/overlays/chromeos-partner-overlay/+/f317dce762378754eedd8a4b99c41375c1fa0c87

commit f317dce762378754eedd8a4b99c41375c1fa0c87
Author: Ting-Yuan Huang <laszio@google.com>
Date: Wed Aug 10 19:22:15 2016

Project Member

Comment 19 by bugdroid1@chromium.org, Sep 9 2016

The following revision refers to this bug:
  https://chrome-internal.googlesource.com/chromeos/overlays/chromeos-partner-overlay/+/f317dce762378754eedd8a4b99c41375c1fa0c87

commit f317dce762378754eedd8a4b99c41375c1fa0c87
Author: Ting-Yuan Huang <laszio@google.com>
Date: Wed Aug 10 19:22:15 2016

Sign in to add a comment