32bit chromium 79: compiling gn fails on final link

13 views
Skip to first unread message

Eric Hameleers

unread,
Dec 14, 2019, 5:03:15 PM12/14/19
to chromium-packagers
For Slackware's chromium package, I first compile Google's customized clang and then I compile gn from the sources in the chromium tarball. This allows me to create a Chromium package on our somewhat ageing Slackware 14.2, and in addition, compile a 32bit package on our 32bit platform.

When trying to compile the first stable Chromium 79 source release I run into an issue on 32bit (64bit is fine). I get the following errors when gn is linked:

[181/182] AR gn_lib.a
[182/182] LINK gn
FAILED: gn 
clang++ -Wl,-z,notext -nodefaultlibs libc++.gn.so -lpthread -lc -lm -Wl,-rpath="\$ORIGIN/." -Wl,-rpath-link=. -O3 -fdata-sections -ffunction-sections -Wl,--gc-sections -Wl,-strip-all -Wl,--as-needed -static-libstdc++ -pthread -o gn -Wl,--start-group tools/gn/gn_main.o base.a gn_lib.a -Wl,--end-group -ldl
clang-10: warning: argument unused during compilation: '-static-libstdc++' [-Wunused-command-line-argument]
clang-10: warning: argument unused during compilation: '-pthread' [-Wunused-command-line-argument]
ld: error: undefined symbol: __udivdi3
>>> referenced by string_number_conversions.cc
>>>               base/strings/string_number_conversions.o:(base::NumberToString(long long)) in archive base.a
>>> referenced by command_gen.cc
>>>               tools/gn/command_gen.o:(commands::RunGen(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&)) in archive gn_lib.a
>>> referenced by command_gen.cc
>>>               tools/gn/command_gen.o:(commands::RunGen(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&)) in archive gn_lib.a
>>> referenced by command_gen.cc
>>>               tools/gn/command_gen.o:(commands::RunGen(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&)) in archive gn_lib.a
>>> referenced by command_gen.cc
>>>               tools/gn/command_gen.o:(commands::RunGen(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&)) in archive gn_lib.a
>>> referenced by command_gen.cc
>>>               tools/gn/command_gen.o:(commands::RunGen(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&)) in archive gn_lib.a
>>> referenced by command_gen.cc
>>>               tools/gn/command_gen.o:(commands::RunGen(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&)) in archive gn_lib.a
>>> referenced by command_gen.cc
>>>               tools/gn/command_gen.o:(commands::RunGen(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&)) in archive gn_lib.a
>>> referenced by function_exec_script.cc
>>>               tools/gn/function_exec_script.o:(functions::RunExecScript(Scope*, FunctionCallNode const*, std::__1::vector<Value, std::__1::allocator<Value> > const&, Err*)) in archive gn_lib.a
>>> referenced by trace.cc
>>>               tools/gn/trace.o:(SaveTraces(base::FilePath const&)) in archive gn_lib.a
>>> referenced 1 more times

ld: error: undefined symbol: __divdi3
>>> referenced by functions.cc
>>>               tools/gn/functions.o:(functions::RunSplitList(Scope*, FunctionCallNode const*, ListNode const*, Err*)) in archive gn_lib.a
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
  File "tools/gn/bootstrap/bootstrap.py", line 137, in <module>
    sys.exit(main(sys.argv[1:]))
  File "tools/gn/bootstrap/bootstrap.py", line 123, in main
    ['ninja', '-C', gn_build_dir, 'gn', '-w', 'dupbuild=err'])
  File "/usr/lib/python2.7/subprocess.py", line 190, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ninja', '-C', '/mnt/hd/build/tmp-chromium/chromium-79.0.3945.79/out/Release/gn_build', 'gn', '-w', 'dupbuild=err']' returned non-zero exit status 1

This has never happened before.
I must note that I was only able to compile gn on 64bit after adding "--use-custom-libcxx" as an argument to "bootstrap.py". Apparently our distro library is too old to support C++17.
Can this linking error be fixed?

Reply all
Reply to author
Forward
0 new messages