Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make #294

Open
littleforce163 opened this issue Oct 27, 2020 · 5 comments
Open

make #294

littleforce163 opened this issue Oct 27, 2020 · 5 comments

Comments

@littleforce163
Copy link

when I build with make I found an error. Any more dependencies required? Please advice. Thanks.
The OS is Ubuntu 18.04, AMD64.

[ 77%] Linking C executable lwan

$ make
Scanning dependencies of target bin2hex
[  1%] Building C object src/bin/tools/CMakeFiles/bin2hex.dir/bin2hex.c.o
[  2%] Linking C executable bin2hex
[  2%] Built target bin2hex
[  3%] Bundling auto-index icons
[  3%] Built target generate_auto_index_icons
Scanning dependencies of target mimegen
[  4%] Building C object src/bin/tools/CMakeFiles/mimegen.dir/mimegen.c.o
[  6%] Building C object src/bin/tools/CMakeFiles/mimegen.dir/__/__/lib/hash.c.o
[  7%] Building C object src/bin/tools/CMakeFiles/mimegen.dir/__/__/lib/murmur3.c.o
[  8%] Building C object src/bin/tools/CMakeFiles/mimegen.dir/__/__/lib/missing.c.o
[  9%] Linking C executable mimegen
[  9%] Built target mimegen
[ 10%] Building MIME type table
[ 10%] Built target generate_mime_types_table
Scanning dependencies of target lwan-static
[ 12%] Building C object src/lib/CMakeFiles/lwan-static.dir/base64.c.o
[ 13%] Building C object src/lib/CMakeFiles/lwan-static.dir/hash.c.o
[ 14%] Building C object src/lib/CMakeFiles/lwan-static.dir/int-to-str.c.o
[ 15%] Building C object src/lib/CMakeFiles/lwan-static.dir/list.c.o
[ 16%] Building C object src/lib/CMakeFiles/lwan-static.dir/lwan-array.c.o
[ 18%] Building C object src/lib/CMakeFiles/lwan-static.dir/lwan.c.o
[ 19%] Building C object src/lib/CMakeFiles/lwan-static.dir/lwan-cache.c.o
[ 20%] Building C object src/lib/CMakeFiles/lwan-static.dir/lwan-config.c.o
[ 21%] Building C object src/lib/CMakeFiles/lwan-static.dir/lwan-coro.c.o
[ 22%] Building C object src/lib/CMakeFiles/lwan-static.dir/lwan-http-authorize.c.o
[ 24%] Building C object src/lib/CMakeFiles/lwan-static.dir/lwan-io-wrappers.c.o
[ 25%] Building C object src/lib/CMakeFiles/lwan-static.dir/lwan-job.c.o
[ 26%] Building C object src/lib/CMakeFiles/lwan-static.dir/lwan-mod-redirect.c.o
[ 27%] Building C object src/lib/CMakeFiles/lwan-static.dir/lwan-mod-response.c.o
[ 28%] Building C object src/lib/CMakeFiles/lwan-static.dir/lwan-mod-rewrite.c.o
[ 30%] Building C object src/lib/CMakeFiles/lwan-static.dir/lwan-mod-serve-files.c.o
[ 31%] Building C object src/lib/CMakeFiles/lwan-static.dir/lwan-readahead.c.o
/cython-lwan-master/lwan/src/lib/lwan-readahead.c: In function ‘lwan_readahead_shutdown’:
/cython-lwan-master/lwan/src/lib/lwan-readahead.c:84:5: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
     write(readahead_pipe_fd[1], &cmd, sizeof(cmd));
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/cython-lwan-master/lwan/src/lib/lwan-readahead.c: In function ‘lwan_readahead_queue’:
/cython-lwan-master/lwan/src/lib/lwan-readahead.c:103:5: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
     write(readahead_pipe_fd[1], &cmd, sizeof(cmd));
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/cython-lwan-master/lwan/src/lib/lwan-readahead.c: In function ‘lwan_madvise_queue’:
/cython-lwan-master/lwan/src/lib/lwan-readahead.c:117:5: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
     write(readahead_pipe_fd[1], &cmd, sizeof(cmd));
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 32%] Building C object src/lib/CMakeFiles/lwan-static.dir/lwan-request.c.o
[ 33%] Building C object src/lib/CMakeFiles/lwan-static.dir/lwan-response.c.o
[ 34%] Building C object src/lib/CMakeFiles/lwan-static.dir/lwan-socket.c.o
[ 36%] Building C object src/lib/CMakeFiles/lwan-static.dir/lwan-status.c.o
[ 37%] Building C object src/lib/CMakeFiles/lwan-static.dir/lwan-straitjacket.c.o
[ 38%] Building C object src/lib/CMakeFiles/lwan-static.dir/lwan-strbuf.c.o
[ 39%] Building C object src/lib/CMakeFiles/lwan-static.dir/lwan-tables.c.o
[ 40%] Building C object src/lib/CMakeFiles/lwan-static.dir/lwan-template.c.o
[ 42%] Building C object src/lib/CMakeFiles/lwan-static.dir/lwan-thread.c.o
/cython-lwan-master/lwan/src/lib/lwan-thread.c: In function ‘accept_nudge’:
/cython-lwan-master/lwan/src/lib/lwan-thread.c:356:5: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result]
     (void)read(pipe_fd, &event, sizeof(event));
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 43%] Building C object src/lib/CMakeFiles/lwan-static.dir/lwan-time.c.o
[ 44%] Building C object src/lib/CMakeFiles/lwan-static.dir/lwan-tq.c.o
[ 45%] Building C object src/lib/CMakeFiles/lwan-static.dir/lwan-trie.c.o
[ 46%] Building C object src/lib/CMakeFiles/lwan-static.dir/lwan-websocket.c.o
[ 48%] Building C object src/lib/CMakeFiles/lwan-static.dir/lwan-pubsub.c.o
[ 49%] Building C object src/lib/CMakeFiles/lwan-static.dir/missing.c.o
[ 50%] Building C object src/lib/CMakeFiles/lwan-static.dir/missing-pthread.c.o
[ 51%] Building C object src/lib/CMakeFiles/lwan-static.dir/murmur3.c.o
[ 53%] Building C object src/lib/CMakeFiles/lwan-static.dir/patterns.c.o
[ 54%] Building C object src/lib/CMakeFiles/lwan-static.dir/queue.c.o
[ 55%] Building C object src/lib/CMakeFiles/lwan-static.dir/realpathat.c.o
[ 56%] Building C object src/lib/CMakeFiles/lwan-static.dir/sd-daemon.c.o
[ 57%] Building C object src/lib/CMakeFiles/lwan-static.dir/sha1.c.o
[ 59%] Building C object src/lib/CMakeFiles/lwan-static.dir/timeout.c.o
[ 60%] Building C object src/lib/CMakeFiles/lwan-static.dir/lwan-lua.c.o
[ 61%] Building C object src/lib/CMakeFiles/lwan-static.dir/lwan-mod-lua.c.o
[ 62%] Linking C static library liblwan.a
[ 62%] Built target lwan-static
Scanning dependencies of target lwan-shared
[ 63%] Building C object src/lib/CMakeFiles/lwan-shared.dir/__/__/empty.c.o
[ 65%] Linking C shared library liblwan.so
[ 65%] Built target lwan-shared
Scanning dependencies of target configdump
[ 66%] Building C object src/bin/tools/CMakeFiles/configdump.dir/configdump.c.o
[ 67%] Building C object src/bin/tools/CMakeFiles/configdump.dir/__/__/lib/lwan-config.c.o
[ 68%] Building C object src/bin/tools/CMakeFiles/configdump.dir/__/__/lib/lwan-status.c.o
[ 69%] Building C object src/bin/tools/CMakeFiles/configdump.dir/__/__/lib/lwan-strbuf.c.o
[ 71%] Building C object src/bin/tools/CMakeFiles/configdump.dir/__/__/lib/hash.c.o
[ 72%] Building C object src/bin/tools/CMakeFiles/configdump.dir/__/__/lib/murmur3.c.o
[ 73%] Building C object src/bin/tools/CMakeFiles/configdump.dir/__/__/lib/missing.c.o
[ 74%] Linking C executable configdump
[ 74%] Built target configdump
Scanning dependencies of target lwan
[ 75%] Building C object src/bin/lwan/CMakeFiles/lwan.dir/main.c.o
[ 77%] Linking C executable lwan
/tmp/ccZho59s.ltrans1.ltrans.o:(.data.rel.ro.local+0xf0): undefined reference to `.L1997'
/tmp/ccZho59s.ltrans1.ltrans.o:(.data.rel.ro.local+0xf8): undefined reference to `.L1998'
/tmp/ccZho59s.ltrans1.ltrans.o:(.data.rel.ro.local+0x100): undefined reference to `.L1999'
/tmp/ccZho59s.ltrans1.ltrans.o:(.data.rel.ro.local+0x108): undefined reference to `.L2000'
/tmp/ccZho59s.ltrans1.ltrans.o:(.data.rel.ro.local+0x110): undefined reference to `.L2001'
/tmp/ccZho59s.ltrans1.ltrans.o:(.data.rel.ro.local+0x118): undefined reference to `.L2002'
/tmp/ccZho59s.ltrans1.ltrans.o:(.data.rel.ro.local+0x120): undefined reference to `.L2003'
/tmp/ccZho59s.ltrans1.ltrans.o:(.data.rel.ro.local+0x128): undefined reference to `.L2004'
/tmp/ccZho59s.ltrans1.ltrans.o:(.data.rel.ro.local+0x130): undefined reference to `.L2005'
/tmp/ccZho59s.ltrans1.ltrans.o:(.data.rel.ro.local+0x138): undefined reference to `.L2006'
/tmp/ccZho59s.ltrans1.ltrans.o:(.data.rel.ro.local+0x140): undefined reference to `.L2007'
collect2: error: ld returned 1 exit status
src/bin/lwan/CMakeFiles/lwan.dir/build.make:96: recipe for target 'src/bin/lwan/lwan' failed
make[2]: *** [src/bin/lwan/lwan] Error 1
CMakeFiles/Makefile2:491: recipe for target 'src/bin/lwan/CMakeFiles/lwan.dir/all' failed
make[1]: *** [src/bin/lwan/CMakeFiles/lwan.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

I paste cmake, too.

$ cmake .. -DCMAKE_BUILD_TYPE=Release
-- Running CMake for lwan (Scalable, high performance, experimental web server)
-- Building with Lua support using luajit-5.1
-- Using built-in context switching routines for x86_64 processors
-- Valgrind headers not found -- disabling valgrind support
-- Using Brotli for mimegen
-- Found MySQL includes at /usr/include/mysql
-- Not building benchmark suite: database libraries not found.
-- Configuring done
-- Generating done
-- Build files have been written to: /cython-lwan-master/lwan/build

@lpereira
Copy link
Owner

I don't know what's the issue here. I don't have a Ubuntu 18.04 environment setup here to test this right now. Can you do me a favor and see if you can build a Debug build? (Use a different build directory or at least remove CMakeCache.txt from the build directory you used for the Release build.)

@kmx2
Copy link

kmx2 commented Nov 11, 2020

I have met the same problem. OS is Ubuntu 16.04.

@kmx2
Copy link

kmx2 commented Nov 11, 2020

using Debug option has no problem. Why?

@lpereira
Copy link
Owner

I don't know exactly what's going on here; the error seems to stem from the usage of a link-time flag enabling a read-only GOT (which is enabled for both Debug and Release builds), but since it's enabled for both builds, it might be a clash with something that's enabled only in Release builds. My money is in LTO.

I might install a Ubuntu 18.04 VM here to experiment with this. No promises, though, as I'm taking a sabbatical from open source work; however, if I end up doing this, these are some of the things I'm going to try:

  • Use the gold linker instead: passing -DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=gold to CMake
  • Build with clang by setting the CC=clang environment variable before invoking CMake
  • Maybe try modifying CMakeLists.txt and seeing if removing options to enable the read-only GOT, building without a PLT, or things like this, will affect the outcome.

@pythonmcpi
Copy link

pythonmcpi commented Jan 4, 2021

I'm getting the exact same error when building on a Raspberry Pi 3B+, Raspbian (not a fresh install)
(Raspberry Pi is ARMv7 I think)
The same error happens with both Release and RelWithDebugInfo, but lwan builds fine with Debug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants