← Back to team overview

kicad-developers team mailing list archive

Re: Build error on Fedora KiCad copr

 

On 11/5/18 9:49 AM, John Beard wrote:
> Gah! Wrong patch! Try this.

That's better!  I got a clean build with your new patch.  Please commit it, and thanks!

	Steve

> On Mon, Nov 5, 2018 at 2:43 PM Steven A. Falco <stevenfalco@xxxxxxxxx> wrote:
>>
>> On 11/5/18 5:24 AM, John Beard wrote:
>>> Hi,
>>>
>>> This appears to be because something in the build is setting the CMake
>>> BUILD_SHARED_LIBS option to ON (the default is not set at all). See
>>> build log line 124.
>>>
>>> qa_utils is not explicitly declared STATIC like the rest of KiCad
>>> internal libs, but it depends on common, which is. This causes Bad
>>> Things, like being unable to link qa_utils.
>>>
>>> Attached is a patch to make qa_utils STATIC, since making KiCad
>>> internals shareable is not (currently??) possible, so it should
>>> override the build environment setting if given.
>>>
>>> Patch is not Jenkins'ed but it does build for me.
>>
>> Interesting.  I get the following:
>>
>> [ 73%] Linking CXX shared library libqa_utils.so
>> cd /builddir/build/BUILD/kicad-r14377-4ad37bc9/qa/qa_utils && /usr/bin/cmake -E cmake_link_script CMakeFiles/qa_utils.dir/link.txt --verbose=1
>> /usr/bin/c++ -fPIC -Wall -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wsuggest-override -Werror=vla -Wno-unused-local-typedefs -Wno-strict-aliasing -pthread -g3 -ggdb3 -DDEBUG -Wno-deprecated-declarations -Wl,--no-undefined -Wl,-Bsymbolic -shared -Wl,-soname,libqa_utils.so -o libqa_utils.so CMakeFiles/qa_utils.dir/stdstream_line_reader.cpp.o -lSTATIC ../../common/libcommon.a -pthread -lwx_gtk2u_gl-3.0 -lwx_gtk2u_aui-3.0 -lwx_gtk2u_adv-3.0 -lwx_gtk2u_html-3.0 -lwx_gtk2u_core-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0 -lwx_baseu_xml-3.0 -lwx_gtk2u_stc-3.0 ../../common/libgal.a -lGLEW -lcairo -lpixman-1 -lGL -lGLU -lcurl -lssl -lcrypto
>> BUILDSTDERR: /usr/bin/ld: cannot find -lSTATIC
>> BUILDSTDERR: collect2: error: ld returned 1 exit status
>> BUILDSTDERR: make[2]: *** [qa/qa_utils/CMakeFiles/qa_utils.dir/build.make:97: qa/qa_utils/libqa_utils.so] Error 1
>> make[2]: Leaving directory '/builddir/build/BUILD/kicad-r14377-4ad37bc9'
>> BUILDSTDERR: make[1]: *** [CMakeFiles/Makefile2:3342: qa/qa_utils/CMakeFiles/qa_utils.dir/all] Error 2
>> BUILDSTDERR: make[1]: *** Waiting for unfinished jobs....
>>
>> It seems that the makefiles think STATIC is a library.
>>
>>         Steve
>>
>>>
>>> Cheers,
>>>
>>> John
>>> On Sun, Nov 4, 2018 at 2:16 PM Steven A. Falco <stevenfalco@xxxxxxxxx> wrote:
>>>>
>>>> The following discussion is from [KiCad/fedora-packaging] Handle ambiguous Python shebang (#20).  I'm cross-posting to kicad-developers since I'm not sure who sees the fedora-packaging emails.  Please don't hate me. :-)
>>>>
>>>> On 11/4/18 6:05 AM, nickoe wrote:
>>>>> The patch was merged upstream, I consider this the replacement for this pull request. I know the fedora packaging scripts will still warn, but the error is gone.
>>>>>
>>>>> Next up are some linking issues, if anyone cares to look at the latest copr build logs.
>>>>
>>>> According to the log, we have errors in io_benchmark.cpp:
>>>>
>>>> undefined reference to `IFSTREAM_LINE_READER::IFSTREAM_LINE_READER(wxFileName const&)'
>>>> undefined reference to `STDISTREAM_LINE_READER::ReadLine()'
>>>> undefined reference to `IFSTREAM_LINE_READER::Rewind()'
>>>> undefined reference to `STDISTREAM_LINE_READER::~STDISTREAM_LINE_READER()'
>>>>
>>>> This _might_ be due to b88121e377b7244519715b604bd50026b2af440e (Add an in-memory STREAM_LINE_READER benchmark), which is the only commit I see in 2018 that touches io_benchmark.cpp.  Or it could be something that changed in a Makefile.  I am not knowledgeable enough to determine that.
>>>>
>>>> For reference, here is the full text of the error log.  It also mentions qa_utils/stdstream_line_reader.h, which appears to be part of the same issue:
>>>>
>>>> BUILDSTDERR: /usr/bin/ld: CMakeFiles/io_benchmark.dir/io_benchmark.cpp.o: in function `void bench_line_reader_reuse<IFSTREAM_LINE_READER>(wxFileName const&, int, BENCH_REPORT&)':
>>>> BUILDSTDERR: /usr/bin/ld: CMakeFiles/io_benchmark.dir/io_benchmark.cpp.o: in function `void bench_line_reader_reuse<IFSTREAM_LINE_READER>(wxFileName const&, int, BENCH_REPORT&)':
>>>> BUILDSTDERR: /builddir/build/BUILD/kicad-r14365-75896d76/tools/io_benchmark/io_benchmark.cpp:143: undefined reference to `IFSTREAM_LINE_READER::IFSTREAM_LINE_READER(wxFileName const&)'
>>>> BUILDSTDERR: /builddir/build/BUILD/kicad-r14365-75896d76/tools/io_benchmark/io_benchmark.cpp:143: undefined reference to `IFSTREAM_LINE_READER::IFSTREAM_LINE_READER(wxFileName const&)'
>>>> BUILDSTDERR: /usr/bin/ld: /builddir/build/BUILD/kicad-r14365-75896d76/tools/io_benchmark/io_benchmark.cpp:147: undefined reference to `STDISTREAM_LINE_READER::ReadLine()'
>>>> BUILDSTDERR: /usr/bin/ld: /builddir/build/BUILD/kicad-r14365-75896d76/tools/io_benchmark/io_benchmark.cpp:147: undefined reference to `STDISTREAM_LINE_READER::ReadLine()'
>>>> BUILDSTDERR: /usr/bin/ld: /builddir/build/BUILD/kicad-r14365-75896d76/tools/io_benchmark/io_benchmark.cpp:153: undefined reference to `IFSTREAM_LINE_READER::Rewind()'
>>>> BUILDSTDERR: /usr/bin/ld: /builddir/build/BUILD/kicad-r14365-75896d76/tools/io_benchmark/io_benchmark.cpp:153: undefined reference to `IFSTREAM_LINE_READER::Rewind()'
>>>> BUILDSTDERR: /usr/bin/ld: CMakeFiles/io_benchmark.dir/io_benchmark.cpp.o: in function `void bench_line_reader_reuse<IFSTREAM_LINE_READER>(wxFileName const&, int, BENCH_REPORT&)':
>>>> BUILDSTDERR: /usr/bin/ld: CMakeFiles/io_benchmark.dir/io_benchmark.cpp.o: in function `void bench_line_reader_reuse<IFSTREAM_LINE_READER>(wxFileName const&, int, BENCH_REPORT&)':
>>>> BUILDSTDERR: /builddir/build/BUILD/kicad-r14365-75896d76/qa/qa_utils/stdstream_line_reader.h:62: undefined reference to `STDISTREAM_LINE_READER::~STDISTREAM_LINE_READER()'
>>>> BUILDSTDERR: /builddir/build/BUILD/kicad-r14365-75896d76/qa/qa_utils/stdstream_line_reader.h:62: undefined reference to `STDISTREAM_LINE_READER::~STDISTREAM_LINE_READER()'
>>>> BUILDSTDERR: /usr/bin/ld: CMakeFiles/io_benchmark.dir/io_benchmark.cpp.o: in function `void bench_line_reader<IFSTREAM_LINE_READER>(wxFileName const&, int, BENCH_REPORT&)':
>>>> BUILDSTDERR: /usr/bin/ld: CMakeFiles/io_benchmark.dir/io_benchmark.cpp.o: in function `void bench_line_reader<IFSTREAM_LINE_READER>(wxFileName const&, int, BENCH_REPORT&)':
>>>> BUILDSTDERR: /builddir/build/BUILD/kicad-r14365-75896d76/tools/io_benchmark/io_benchmark.cpp:126: undefined reference to `IFSTREAM_LINE_READER::IFSTREAM_LINE_READER(wxFileName const&)'
>>>> BUILDSTDERR: /builddir/build/BUILD/kicad-r14365-75896d76/tools/io_benchmark/io_benchmark.cpp:126: undefined reference to `IFSTREAM_LINE_READER::IFSTREAM_LINE_READER(wxFileName const&)'
>>>> BUILDSTDERR: /usr/bin/ld: /builddir/build/BUILD/kicad-r14365-75896d76/tools/io_benchmark/io_benchmark.cpp:127: undefined reference to `STDISTREAM_LINE_READER::ReadLine()'
>>>> BUILDSTDERR: /usr/bin/ld: /builddir/build/BUILD/kicad-r14365-75896d76/tools/io_benchmark/io_benchmark.cpp:127: undefined reference to `STDISTREAM_LINE_READER::ReadLine()'
>>>> BUILDSTDERR: /usr/bin/ld: CMakeFiles/io_benchmark.dir/io_benchmark.cpp.o: in function `void bench_line_reader<IFSTREAM_LINE_READER>(wxFileName const&, int, BENCH_REPORT&)':
>>>> BUILDSTDERR: /usr/bin/ld: CMakeFiles/io_benchmark.dir/io_benchmark.cpp.o: in function `void bench_line_reader<IFSTREAM_LINE_READER>(wxFileName const&, int, BENCH_REPORT&)':
>>>> BUILDSTDERR: /builddir/build/BUILD/kicad-r14365-75896d76/qa/qa_utils/stdstream_line_reader.h:62: undefined reference to `STDISTREAM_LINE_READER::~STDISTREAM_LINE_READER()'
>>>> BUILDSTDERR: /builddir/build/BUILD/kicad-r14365-75896d76/qa/qa_utils/stdstream_line_reader.h:62: undefined reference to `STDISTREAM_LINE_READER::~STDISTREAM_LINE_READER()'
>>>> BUILDSTDERR: /usr/bin/ld: CMakeFiles/io_benchmark.dir/io_benchmark.cpp.o: in function `IFSTREAM_LINE_READER::~IFSTREAM_LINE_READER()':
>>>> BUILDSTDERR: /usr/bin/ld: CMakeFiles/io_benchmark.dir/io_benchmark.cpp.o: in function `IFSTREAM_LINE_READER::~IFSTREAM_LINE_READER()':
>>>> BUILDSTDERR: /builddir/build/BUILD/kicad-r14365-75896d76/qa/qa_utils/stdstream_line_reader.h:62: undefined reference to `STDISTREAM_LINE_READER::~STDISTREAM_LINE_READER()'
>>>> BUILDSTDERR: /builddir/build/BUILD/kicad-r14365-75896d76/qa/qa_utils/stdstream_line_reader.h:62: undefined reference to `STDISTREAM_LINE_READER::~STDISTREAM_LINE_READER()'
>>>> BUILDSTDERR: /usr/bin/ld: CMakeFiles/io_benchmark.dir/io_benchmark.cpp.o: in function `IFSTREAM_LINE_READER::~IFSTREAM_LINE_READER()':
>>>> BUILDSTDERR: /usr/bin/ld: CMakeFiles/io_benchmark.dir/io_benchmark.cpp.o: in function `IFSTREAM_LINE_READER::~IFSTREAM_LINE_READER()':
>>>> BUILDSTDERR: /builddir/build/BUILD/kicad-r14365-75896d76/qa/qa_utils/stdstream_line_reader.h:62: undefined reference to `STDISTREAM_LINE_READER::~STDISTREAM_LINE_READER()'
>>>> BUILDSTDERR: /builddir/build/BUILD/kicad-r14365-75896d76/qa/qa_utils/stdstream_line_reader.h:62: undefined reference to `STDISTREAM_LINE_READER::~STDISTREAM_LINE_READER()'
>>>> BUILDSTDERR: /usr/bin/ld: CMakeFiles/io_benchmark.dir/io_benchmark.cpp.o: in function `void bench_line_reader_reuse<IFSTREAM_LINE_READER>(wxFileName const&, int, BENCH_REPORT&) [clone .cold.152]':
>>>> BUILDSTDERR: /usr/bin/ld: CMakeFiles/io_benchmark.dir/io_benchmark.cpp.o: in function `void bench_line_reader_reuse<IFSTREAM_LINE_READER>(wxFileName const&, int, BENCH_REPORT&) [clone .cold.152]':
>>>> BUILDSTDERR: /builddir/build/BUILD/kicad-r14365-75896d76/qa/qa_utils/stdstream_line_reader.h:62: undefined reference to `STDISTREAM_LINE_READER::~STDISTREAM_LINE_READER()'
>>>> BUILDSTDERR: /builddir/build/BUILD/kicad-r14365-75896d76/qa/qa_utils/stdstream_line_reader.h:62: undefined reference to `STDISTREAM_LINE_READER::~STDISTREAM_LINE_READER()'
>>>> BUILDSTDERR: /usr/bin/ld: CMakeFiles/io_benchmark.dir/io_benchmark.cpp.o: in function `void bench_line_reader<IFSTREAM_LINE_READER>(wxFileName const&, int, BENCH_REPORT&) [clone .cold.153]':
>>>> BUILDSTDERR: /usr/bin/ld: CMakeFiles/io_benchmark.dir/io_benchmark.cpp.o: in function `void bench_line_reader<IFSTREAM_LINE_READER>(wxFileName const&, int, BENCH_REPORT&) [clone .cold.153]':
>>>> BUILDSTDERR: /builddir/build/BUILD/kicad-r14365-75896d76/qa/qa_utils/stdstream_line_reader.h:62: undefined reference to `STDISTREAM_LINE_READER::~STDISTREAM_LINE_READER()'
>>>> BUILDSTDERR: /builddir/build/BUILD/kicad-r14365-75896d76/qa/qa_utils/stdstream_line_reader.h:62: undefined reference to `STDISTREAM_LINE_READER::~STDISTREAM_LINE_READER()'
>>>> BUILDSTDERR: /usr/bin/ld: CMakeFiles/io_benchmark.dir/io_benchmark.cpp.o:(.data.rel.ro._ZTI20IFSTREAM_LINE_READER[_ZTI20IFSTREAM_LINE_READER]+0x10): undefined reference to `typeinfo for STDISTREAM_LINE_READER'
>>>> BUILDSTDERR: /usr/bin/ld: CMakeFiles/io_benchmark.dir/io_benchmark.cpp.o:(.data.rel.ro._ZTI20IFSTREAM_LINE_READER[_ZTI20IFSTREAM_LINE_READER]+0x10): undefined reference to `typeinfo for STDISTREAM_LINE_READER'
>>>> BUILDSTDERR: /usr/bin/ld: CMakeFiles/io_benchmark.dir/io_benchmark.cpp.o:(.data.rel.ro._ZTV20IFSTREAM_LINE_READER[_ZTV20IFSTREAM_LINE_READER]+0x20): undefined reference to `STDISTREAM_LINE_READER::ReadLine()'
>>>> BUILDSTDERR: /usr/bin/ld: CMakeFiles/io_benchmark.dir/io_benchmark.cpp.o:(.data.rel.ro._ZTV20IFSTREAM_LINE_READER[_ZTV20IFSTREAM_LINE_READER]+0x20): undefined reference to `STDISTREAM_LINE_READER::ReadLine()'
>>>> BUILDSTDERR: collect2: error: ld returned 1 exit status
>>>> BUILDSTDERR: collect2: error: ld returned 1 exit status
>>>> BUILDSTDERR: make[2]: *** [tools/io_benchmark/CMakeFiles/io_benchmark.dir/build.make:99: tools/io_benchmark/io_benchmark] Error 1
>>>> BUILDSTDERR: make[2]: *** [tools/io_benchmark/CMakeFiles/io_benchmark.dir/build.make:99: tools/io_benchmark/io_benchmark] Error 1
>>>>
>>>>         Steve
>>>>
>>>> _______________________________________________
>>>> Mailing list: https://launchpad.net/~kicad-developers
>>>> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
>>>> Unsubscribe : https://launchpad.net/~kicad-developers
>>>> More help   : https://help.launchpad.net/ListHelp
>>



References