Build issues when trying to make an official Linux GN build

70 visningar
Hoppa till det första olästa meddelandet

Daniel Cheng

oläst,
26 juli 2016 22:42:572016-07-26
till Chromium-dev
I'm using GN and trying to make an official build. I'm following the directions in https://www.chromium.org/developers/gn-build-configuration, and I have src-internal checked out: the only addition is symbol_level = 2 to my args.gn.

However, when I try to build, I always run into this error:
../../third_party/binutils/Linux_x64/Release/bin/ld.gold: error: obj/third_party/brotli/libbrotli.a: no archive symbol table (run ranlib)
/tmp/lto-llvm-dfa065.o:ld-temp.o:function brotli::HashLongestMatch<15, 8, 16>::FindLongestMatch(unsigned char const*, unsigned long, int const*, unsigned long, unsigned long, unsigned long, unsigned long*, unsigned long*, unsigned long*, double*): error: undefined reference to 'kBrotliDictionary'
/tmp/lto-llvm-dfa065.o:ld-temp.o:function brotli::HashLongestMatch<15, 8, 16>::FindLongestMatch(unsigned char const*, unsigned long, int const*, unsigned long, unsigned long, unsigned long, unsigned long*, unsigned long*, unsigned long*, double*): error: undefined reference to 'kBrotliDictionary'
/tmp/lto-llvm-dfa065.o:ld-temp.o:function brotli::HashLongestMatch<15, 8, 16>::FindLongestMatch(unsigned char const*, unsigned long, int const*, unsigned long, unsigned long, unsigned long, unsigned long*, unsigned long*, unsigned long*, double*): error: undefined reference to 'kBrotliDictionary'
/tmp/lto-llvm-dfa065.o:ld-temp.o:function brotli::HashLongestMatch<15, 7, 10>::FindLongestMatch(unsigned char const*, unsigned long, int const*, unsigned long, unsigned long, unsigned long, unsigned long*, unsigned long*, unsigned long*, double*): error: undefined reference to 'kBrotliDictionary'
/tmp/lto-llvm-dfa065.o:ld-temp.o:function main: error: undefined reference to 'BrotliCreateState'
/tmp/lto-llvm-dfa065.o:ld-temp.o:function main: error: undefined reference to 'BrotliDecompressStream'
/tmp/lto-llvm-dfa065.o:ld-temp.o:function main: error: undefined reference to 'BrotliDestroyState'
clang-3.9: error: linker command failed with exit code 1 (use -v to see invocation)

Has anyone built official successfully? What steps did you follow to make it work?

Daniel

Ivan Krasin

oläst,
26 juli 2016 22:52:382016-07-26
till dch...@chromium.org, Chromium-dev
Hi Daniel,

have you run build/download_gold_plugin.py? If not, please, clean the build, run the script and run again.
Soon, we'll move from using Gold+LLVM Gold plugin to plain lld, and this step will become unnecessary: https://crbug.com/607968

krasin

Ivan Krasin

oläst,
26 juli 2016 23:48:242016-07-26
till dch...@chromium.org, Chromium-dev
I have verified the doc: https://www.chromium.org/developers/gn-build-configuration
It does not explicitly mention download_gold.py explicitly, because running gclient sync with GYP_DEFINES='buildtype=Official branding=Chrome' automatically downloads it:

I also verified locally that the official Chrome with symbol_level=2 builds successfully.

krasin

Daniel Cheng

oläst,
26 juli 2016 23:48:242016-07-26
till Ivan Krasin, Chromium-dev
Ah, no. That was the missing part.

This doesn't seem to be covered by documentation anywhere though. I've added a reference to it on the GN build page, even though it feels a bit out of place there.

Daniel

Daniel Cheng

oläst,
26 juli 2016 23:51:142016-07-26
till Ivan Krasin, Chromium-dev
It seems unintuitive to me that you'd have to set GYP_DEFINES for GN... I originally just ignored that part because I didn't understand why GYP_DEFINES would be used in a GN build.

Daniel

Ivan Krasin

oläst,
26 juli 2016 23:52:452016-07-26
till Daniel Cheng, Chromium-dev
Yes, it's not intuitive, and I get caught on that every now and then. Hopefully, we'll soon migrate to lld and remove this pain point.

Dirk Pranke

oläst,
27 juli 2016 12:38:312016-07-27
till Daniel Cheng, Ivan Krasin, Chromium-dev
We still need the GYP_DEFINES because there are hooks run during `gclient runhooks` that need to do things conditionally (like download the gold plugin). The only mechanism we have for setting things conditionally at the moment is to use an env var, and so leaving GYP_DEFINES in place for this made sense across the GYP->GN transition.

We need to come up with something better soon, though (obviously), because I don't think anyone wants to keep GYP_DEFINES around. There's a bug on file for this (crbug.com/570091) and I know roughly how I want to fix it, but I haven't had time to implement it yet.

-- Dirk

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev

Svara alla
Svara författaren
Vidarebefordra
0 nya meddelanden