bebbo / amiga-gcc

The GNU C-Compiler with Binutils and other useful tools for cross development for Amiga
GNU General Public License v2.0
319 stars 66 forks source link

gcc fails to compile on macOS Sonoma (14.1) #367

Closed CezaryKulakowski closed 10 months ago

CezaryKulakowski commented 10 months ago

I have macbook pro 16' with Intel i9. I go through the configuration list from README. Compilation of the gcc fails with following errors:

gmake[2]: Entering directory '/Users/xxx/views/amiga-gcc/build-Darwin-m68k-amigaos/gcc/gcc'
g++-12 -fno-PIE -c   -Os -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE   -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -I. -I. -I/Users/xxx/views/amiga-gcc/projects/gcc/gcc -I/Users/xxx/views/amiga-gcc/projects/gcc/gcc/. -I/Users/xxx/views/amiga-gcc/projects/gcc/gcc/../include -I/Users/xxx/views/amiga-gcc/projects/gcc/gcc/../libcpp/include -I/usr/local/include -I/usr/local/include -I/usr/local/include  -I/Users/xxx/views/amiga-gcc/projects/gcc/gcc/../libdecnumber -I/Users/xxx/views/amiga-gcc/projects/gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I/Users/xxx/views/amiga-gcc/projects/gcc/gcc/../libbacktrace   -o graphite-isl-ast-to-gimple.o -MT graphite-isl-ast-to-gimple.o -MMD -MP -MF ./.deps/graphite-isl-ast-to-gimple.TPo /Users/xxx/views/amiga-gcc/projects/gcc/gcc/graphite-isl-ast-to-gimple.c
/Users/xxx/views/amiga-gcc/projects/gcc/gcc/graphite-isl-ast-to-gimple.c: In member function 'tree_node* translate_isl_ast_to_gimple::gcc_expression_from_isl_expr_int(tree, isl_ast_expr*)':
/Users/xxx/views/amiga-gcc/projects/gcc/gcc/graphite-isl-ast-to-gimple.c:349:3: error: 'isl_val_free' was not declared in this scope; did you mean 'isl_vec_free'?
  349 |   isl_val_free (val);
      |   ^~~~~~~~~~~~
      |   isl_vec_free
/Users/xxx/views/amiga-gcc/projects/gcc/gcc/graphite-isl-ast-to-gimple.c: In function 'isl_ast_expr* get_upper_bound(isl_ast_node*)':
/Users/xxx/views/amiga-gcc/projects/gcc/gcc/graphite-isl-ast-to-gimple.c:752:11: error: 'isl_val_int_from_si' was not declared in this scope; did you mean 'isl_val_int_from_gmp'?
  752 |           isl_val_int_from_si (isl_ast_expr_get_ctx (for_cond), 1);
      |           ^~~~~~~~~~~~~~~~~~~
      |           isl_val_int_from_gmp
In file included from /Users/xxx/views/amiga-gcc/projects/gcc/gcc/hash-table.h:236,
                 from /Users/xxx/views/amiga-gcc/projects/gcc/gcc/coretypes.h:348,
                 from /Users/xxx/views/amiga-gcc/projects/gcc/gcc/graphite-isl-ast-to-gimple.c:29:
/Users/xxx/views/amiga-gcc/projects/gcc/gcc/vec.h: In instantiation of 'bool vec<T, va_heap, vl_ptr>::reserve(unsigned int, bool) [with T = std::pair<gphi*, gphi*>]':
/Users/xxx/views/amiga-gcc/projects/gcc/gcc/vec.h:1515:3:   required from 'T* vec<T, va_heap, vl_ptr>::safe_push(const T&) [with T = std::pair<gphi*, gphi*>]'
/Users/xxx/views/amiga-gcc/projects/gcc/gcc/graphite-isl-ast-to-gimple.c:1881:38:   required from here
/Users/xxx/views/amiga-gcc/projects/gcc/gcc/vec.h:1409:14: warning: 'void* memcpy(void*, const void*, size_t)' writing to an object of type 'struct std::pair<gphi*, gphi*>' with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
 1409 |       memcpy (m_vec->address (), oldvec->address (), sizeof (T) * oldsize);
      |       ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/local/Cellar/gcc@12/12.3.0/include/c++/12/bits/stl_algobase.h:64,
                 from /usr/local/Cellar/gcc@12/12.3.0/include/c++/12/bits/stl_tree.h:63,
                 from /usr/local/Cellar/gcc@12/12.3.0/include/c++/12/map:60,
                 from /Users/xxx/views/amiga-gcc/projects/gcc/gcc/system.h:228,
                 from /Users/xxx/views/amiga-gcc/projects/gcc/gcc/graphite-isl-ast-to-gimple.c:28:
/usr/local/Cellar/gcc@12/12.3.0/include/c++/12/bits/stl_pair.h:185:12: note: 'struct std::pair<gphi*, gphi*>' declared here
  185 |     struct pair
      |            ^~~~
gmake[2]: *** [Makefile:1121: graphite-isl-ast-to-gimple.o] Error 1
make gcc...failed
use less "log/make gcc.log" to view the full log and search for ***
bebbo commented 10 months ago

see #336, #341

CezaryKulakowski commented 10 months ago

It seems the solution proposed in #336 doesn't work anymore as it's not possible to downgade isl:

brew install isl@0.18
Error: isl@0.18 has been disabled because it is a versioned formula!
CezaryKulakowski commented 10 months ago

According to information from here https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/i/isl%400.18.rb isl in version 0.18 is disabled since 2023-10-03 so it's no longer possible to install it via brew.

bebbo commented 10 months ago

then use the other solution: https://github.com/bebbo/amiga-gcc/issues/341#issuecomment-1537429618

CezaryKulakowski commented 10 months ago

I fetched isl 0.18 from https://libisl.sourceforge.io/isl-0.18.tar.xz and I built and installed it manually (configure/make/make install). It solved the problem.

bebbo commented 10 months ago

that's what contrib/download_prerequisites does too: it downloads matching verions of isl, gmp, mpc and mpfr and the Makefile automatically picks that up.