[MacPorts] #68659: mips-elf-gcc @3.4.6_0: fails to build due to implicit declaration of abort()
MacPorts
noreply at macports.org
Wed Nov 8 18:11:34 UTC 2023
#68659: mips-elf-gcc @3.4.6_0: fails to build due to implicit declaration of
abort()
-----------------------+--------------------
Reporter: nneonneo | Owner: (none)
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.8.1
Resolution: | Keywords:
Port: |
-----------------------+--------------------
Comment (by nneonneo):
Got a successful build with the following changes:
- Configure with `CC='/usr/bin/clang -Wno-error=implicit-function-
declaration'` and with `CXXFLAGS='-Os
-isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk'` (note:
*no* `-stdlib=libc++` in CXXFLAGS!)
- Build with `CPATH` unset
- I made a few other small changes, but those shouldn't have been required
to actually make things work.
We need `-Wno-error=implicit-function-declaration` to get `STDC_HEADERS`
defined and fix many errors while building this old GCC; notably, we
cannot put the flag in `CFLAGS` because otherwise it would be picked up
while cross-compiling the target libraries, and the target GCC doesn't
understand this flag. Similarly, we cannot have `-stdlib=libc++` (and
probably shouldn't even have `-isysroot`) in CXXFLAGS as the target GCC
doesn't understand `-stdlib`. More generally, we should probably be
configuring the host and target separately so we can have different
CFLAGS/CXXFLAGS for them.
We also need to unset CPATH because it gets picked up during cross-
compilation, and will cause the compiler to look for target headers in
/opt/local/include which breaks the build.
--
Ticket URL: <https://trac.macports.org/ticket/68659#comment:2>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list