Opened 3 years ago

Closed 19 months ago

#17457 closed bug (fixed)

[Build System] gcc build is broken on macOS

Reported by: diver Owned by: nobody
Priority: normal Milestone: R1/beta4
Component: Build System Version: R1/beta3
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

macOS 10.14.6

error: variable has incomplete type 'const struct host_hooks'

g++  -c   -O2 -std=c++14 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -fno-strict-aliasing -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-error=format-diag -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -I. -I. -I/Volumes/Haiku/buildtools/gcc/gcc -I/Volumes/Haiku/buildtools/gcc/gcc/. -I/Volumes/Haiku/buildtools/gcc/gcc/../include -I/Volumes/Haiku/buildtools/gcc/gcc/../libcpp/include -I/Volumes/Haiku/buildtools/gcc/gcc/../libcody -I/Volumes/Haiku/haiku/generated/cross-tools-x86_64-build/gcc/./gmp -I/Volumes/Haiku/buildtools/gcc/gmp -I/Volumes/Haiku/haiku/generated/cross-tools-x86_64-build/gcc/./mpfr/src -I/Volumes/Haiku/buildtools/gcc/mpfr/src -I/Volumes/Haiku/buildtools/gcc/mpc/src  -I/Volumes/Haiku/buildtools/gcc/gcc/../libdecnumber -I/Volumes/Haiku/buildtools/gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I/Volumes/Haiku/buildtools/gcc/gcc/../libbacktrace -I/Volumes/Haiku/haiku/generated/cross-tools-x86_64-build/gcc/./isl/include -I/Volumes/Haiku/buildtools/gcc/isl/include  -o host-darwin.o -MT host-darwin.o -MMD -MP -MF ./.deps/host-darwin.TPo /Volumes/Haiku/buildtools/gcc/gcc/config/host-darwin.c
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
warning: unknown warning option '-Werror=format-diag' [-Wunknown-warning-option]
/Volumes/Haiku/buildtools/gcc/gcc/config/host-darwin.c:83:25: error: variable has incomplete type 'const struct host_hooks'
const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER;
                        ^
/Volumes/Haiku/buildtools/gcc/gcc/config/host-darwin.c:83:14: note: forward declaration of 'host_hooks'
const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER;
             ^
1 warning and 1 error generated.
make[2]: *** [host-darwin.o] Error 1
make[1]: *** [all-gcc] Error 2
make: *** [all] Error 2
ERROR: Building gcc failed.

Change History (6)

comment:1 by diver, 3 years ago

Summary: [Build System] gcc is broken on macOS[Build System] gcc build is broken on macOS

comment:2 by diver, 3 years ago

It seems to go much further with this patch:

diff --git a/gcc/gcc/config/host-darwin.c b/gcc/gcc/config/host-darwin.c
index 0d26a7602..67ef13c0f 100644
--- a/gcc/gcc/config/host-darwin.c
+++ b/gcc/gcc/config/host-darwin.c
@@ -22,6 +22,8 @@
 #include "coretypes.h"
 #include "diagnostic-core.h"
 #include "config/host-darwin.h"
+#include "hosthooks.h"
+#include "hosthooks-def.h"

It now hangs at:

Checking for compiler with PCH support...

comment:3 by alistairmcmillan, 3 years ago

The original reason for this ticket is now resolved as of https://review.haiku-os.org/c/buildtools/+/5114.

comment:4 by korli, 3 years ago

Milestone: UnscheduledR1/beta4
Resolution: fixed
Status: newclosed

Indeed, should be fixed with btrev43192. Please reopen if needed.

comment:5 by tclaus, 22 months ago

Resolution: fixed
Status: closedreopened

It won't build on Apple Silicon (Apple M1 Pro) without the extra includes from diver.

Error is: /buildtools/gcc/gcc/config/host-darwin.c:84:38: error: use of undeclared identifier 'HOST_HOOKS_INITIALIZER'

Last edited 22 months ago by tclaus (previous) (diff)

comment:6 by pulkomandy, 19 months ago

Resolution: fixed
Status: reopenedclosed

Patch applied in btrev43201.

I'm not sure if this is still needed, but if it gets things working, I guess it's OK for now.

Note: See TracTickets for help on using tickets.