Comments (6)
Thank you for reporting! I don't have gcc-11, but I believe the above change fixes the issue.
from mold.
Thanks! Well since the issue is still open, I think these are all the remaining issues with GCC11. I did make -j50
and this is what remains. I do really have interest in compilers and linkers, but limited c/c++ knowledge. Looks like more semantic trivial gcc-isms from the looks of it.
g++ -g -IoneTBB/include -IxxHash -pthread -std=c++20 -Wno-deprecated-volatile -Wno-switch -DGIT_HASH=\"99e836208a5f45cd41b572e51a29fdddd48f8b98\" -O2 -c -o subprocess.o subprocess.cc
subprocess.cc: In function ‘std::function<void()> fork_child()’:
subprocess.cc:33:34: error: taking address of temporary array
33 | if (read(pipefd[0], (char[1]){}, 1) == 1)
| ^~
subprocess.cc: In lambda function:
subprocess.cc:48:44: error: taking address of temporary array
48 | return [=]() { write(pipefd[1], (char []){1}, 1); };
| ^~~
subprocess.cc: In instantiation of ‘void try_resume_daemon(Context<E>&, char**) [with E = X86_64]’:
subprocess.cc:267:1: required from here
subprocess.cc:156:15: error: taking address of temporary array
156 | i64 r = read(conn, (char[1]){}, 1);
| ~~~~^~~~~~~~~~~~~~~~~~~~~~
subprocess.cc: In instantiation of ‘void daemonize(Context<E>&, char**, std::function<void()>*, std::function<void()>*) [with E = X86_64]’:
subprocess.cc:267:1: required from here
subprocess.cc:222:31: error: taking address of temporary array
222 | *on_complete = [=]() { write(conn, (char []){1}, 1); };
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
subprocess.cc: In instantiation of ‘void try_resume_daemon(Context<E>&, char**) [with E = I386]’:
subprocess.cc:268:1: required from here
subprocess.cc:156:15: error: taking address of temporary array
156 | i64 r = read(conn, (char[1]){}, 1);
| ~~~~^~~~~~~~~~~~~~~~~~~~~~
subprocess.cc: In instantiation of ‘void daemonize(Context<E>&, char**, std::function<void()>*, std::function<void()>*) [with E = I386]’:
subprocess.cc:268:1: required from here
subprocess.cc:222:31: error: taking address of temporary array
222 | *on_complete = [=]() { write(conn, (char []){1}, 1); };
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
subprocess.cc: In function ‘void process_run_subcommand(Context<E>&, int, char**) [with E = X86_64]’:
subprocess.cc:258:1: warning: ‘noreturn’ function does return
258 | }
| ^
subprocess.cc: In function ‘void process_run_subcommand(Context<E>&, int, char**) [with E = I386]’:
subprocess.cc:258:1: warning: ‘noreturn’ function does return
At global scope:
cc1plus: note: unrecognized command-line option ‘-Wno-deprecated-volatile’ may have been intended to silence earlier diagnostics
make: *** [<builtin>: subprocess.o] Error 1
from mold.
In an attempt to use GCC 11, I tried Ubuntu 21, but it looks like GCC 11 is not available via apt. Did you install GCC 11 from source?
from mold.
Yes, I am using a toolchain compiled from source, so I do have to compile zlib and openssl mold's other dependencies as well. I can go to gcc10 if it's known to be better supported. I had compiled llvm12 but I then realized that the system libstdc++ that it was trying to link against is too old (Debian 10), and I did not compile libc++. When you use clang, is it just linking against the system's libstdc++ library? Now that I have gcc11 I can tell llvm12 to use its libraries, I'll try that. Just kind of nice to use 1 toolchain you know. Have you every compiled using libc++?
from mold.
My mold binary is linked against libstdc++ which I believe installed as a part of libstdc++6 package. I didn't build libstdc++ nor clang++ myself.
$ ldd mold
linux-vdso.so.1 (0x00007fffedbb6000)
libcrypto.so.1.1 => /lib/x86_64-linux-gnu/libcrypto.so.1.1 (0x00007fe124a7c000)
libtbb.so.2 => /home/ruiu/mold/oneTBB/build/linux_intel64_gcc_cc9.3.0_libc2.31_kernel5.10.0_release/libtbb.so.2 (0x00007fe124a34000)
libmimalloc.so.1.7 => /home/ruiu/mold/mimalloc/out/release/libmimalloc.so.1.7 (0x00007fe1249fc000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fe1249e0000)
libxxhash.so.0 => /home/ruiu/mold/xxHash/libxxhash.so.0 (0x00007fe1249d0000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fe1249c8000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fe1247e7000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fe124698000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fe12467d000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fe12465a000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fe124468000)
/lib64/ld-linux-x86-64.so.2 (0x00007fe124d73000)
If you just want to use mold on your machine, you can build mold as a statically-linked executable. All you need to do is to build mold as make STATIC=1
on a Ubuntu 20 machine (in a docker environment or something).
from mold.
I made a few changes to make it compile with GCC 11.
from mold.
Related Issues (20)
- riscv64 test segfault with GCC 14 HOT 7
- linux/ppc64el: fails to build LLVM with `./elf/thunks.cc:257: void mold::elf::OutputSection<E>::create_range_extension_thunks(mold::elf::Context<E>&) [with E = mold::elf::PPC64V2]: Assertion `thunk->size() < max_thunk_size' failed.` HOT 10
- Spurious "not claimed by the LTO plugin" when LTO is not used HOT 2
- mold fails to link when used as a linker with rustc, gcc and with lto enabled HOT 2
- `--repro` doesn't archive input files correctly HOT 1
- common/tar.cc:109:12: warning: ignoring return value of 'int ftruncate(int, __off_t)' declared with attribute 'warn_unused_result' [-Wunused-result] HOT 2
- Consider adding `--long-plt` support
- option --section-ordering-file HOT 1
- [RUST] Missing info and/or update needed to readme I think HOT 1
- Building with pyo3 and maturin works with default linker, but not with mold HOT 1
- XWayland segfaults when linked with mold HOT 3
- tool-x
- make install does not install libblake3.so HOT 1
- Compiling from source on CPU without AVX2 fails HOT 2
- .rodata wrong with rust HOT 26
- not able to compile in windows . HOT 3
- -lc not working HOT 3
- --wrap support for MacOS HOT 3
- x86_64-exception-multiple-ehframe fails with GCC 14 HOT 10
- [Question] Is `mold` any compatible at all with wine-tkg (and anything Wine related) to build? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mold.