https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107612
Bug ID: 107612 Summary: plugin/m2rte doesn't build on Mac OS X 10.7 Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: modula2 Assignee: gaius at gcc dot gnu.org Reporter: ro at gcc dot gnu.org Target Milestone: --- Host: x86_64-apple-darwin11.4.2 Target: x86_64-apple-darwin11.4.2 Build: x86_64-apple-darwin11.4.2 Building the current devel/modula-2 branch on Mac OS X 10.7 fails building the m2rte plugin: * First, compilation fails In file included from /vol/gcc/src/hg/master/modula-2/gcc/m2/plugin/m2rte.cc:31: /vol/gcc/src/hg/master/modula-2/gcc/intl.h:30:10: fatal error: libintl.h: No such file or directory 30 | #include <libintl.h> | ^~~~~~~~~~~ There's no system libintl, but the compile command lacks $(INCINTL). To fix this, gcc/Makefile.in needs INCINTL = @INCINTL@ so $(INCINTL) can be used in gcc/m2/Make-lang.in. Then, the current instances of @INCINTL@ in gcc/Makefile.in can also be replaced by $(INCINTL). * This (done manually for now) lets the compilation succeed, but the link still fails: Undefined symbols for architecture x86_64: "__Z13integer_zeropPK9tree_node", referenced from: __ZN12_GLOBAL__N_130pass_warn_exception_inevitable7executeEP8function in m2rte.o "__Z13rtegraph_initv", referenced from: _plugin_init in m2rte.o "__Z15rtegraph_finishv", referenced from: __ZN12_GLOBAL__N_113analyse_graphEPvS0_ in m2rte.o "__Z15rtegraph_lookupP6gimpleP9tree_nodeb", referenced from: __ZN12_GLOBAL__N_130pass_warn_exception_inevitable7executeEP8function in m2rte.o "__Z17rtegraph_discoverv", referenced from: __ZN12_GLOBAL__N_113analyse_graphEPvS0_ in m2rte.o "__Z17rtegraph_get_funcP7rtenode", referenced from: __ZN12_GLOBAL__N_130pass_warn_exception_inevitable7executeEP8function in m2rte.o "__Z17tree_check_failedPK9tree_nodePKciS3_z", referenced from: __ZN12_GLOBAL__N_130pass_warn_exception_inevitable7executeEP8function.cold in m2rte.o "__Z23tree_class_check_failedPK9tree_node15tree_code_classPKciS4_", referenced from: __ZN12_GLOBAL__N_130pass_warn_exception_inevitable7executeEP8function.cold in m2rte.o "__Z24rtegraph_externs_includeP7rtenode", referenced from: __ZN12_GLOBAL__N_130pass_warn_exception_inevitable7executeEP8function in m2rte.o "__Z24rtegraph_include_rtscallP7rtenode", referenced from: __ZN12_GLOBAL__N_130pass_warn_exception_inevitable7executeEP8function in m2rte.o "__Z25tree_operand_check_failediPK9tree_nodePKciS3_", referenced from: __ZN12_GLOBAL__N_130pass_warn_exception_inevitable7executeEP8function.cold in m2rte.o "__Z27rtegraph_candidates_includeP7rtenode", referenced from: __ZN12_GLOBAL__N_130pass_warn_exception_inevitable7executeEP8function in m2rte.o "__Z29rtegraph_constructors_includeP7rtenode", referenced from: __ZN12_GLOBAL__N_130pass_warn_exception_inevitable7executeEP8function in m2rte.o "__Z29rtegraph_set_current_functionP7rtenode", referenced from: __ZN12_GLOBAL__N_130pass_warn_exception_inevitable7executeEP8function in m2rte.o "__Z29tree_int_cst_elt_check_failediiPKciS0_", referenced from: __ZN12_GLOBAL__N_130pass_warn_exception_inevitable7executeEP8function.cold in m2rte.o "__Z30rtegraph_include_function_callP7rtenode", referenced from: __ZN12_GLOBAL__N_130pass_warn_exception_inevitable7executeEP8function in m2rte.o "__Z33tree_contains_struct_check_failedPK9tree_node24tree_node_structure_enumPKciS4_", referenced from: __ZN12_GLOBAL__N_130pass_warn_exception_inevitable7executeEP8function.cold in m2rte.o "__ZN8opt_pass14set_pass_paramEjb", referenced from: __ZTVN12_GLOBAL__N_130pass_warn_exception_inevitableE in m2rte.o "__ZN8opt_pass4gateEP8function", referenced from: __ZTVN12_GLOBAL__N_130pass_warn_exception_inevitableE in m2rte.o "__ZN8opt_pass5cloneEv", referenced from: __ZTVN12_GLOBAL__N_130pass_warn_exception_inevitableE in m2rte.o "__ZN8opt_passC2ERK9pass_dataPN3gcc7contextE", referenced from: _plugin_init in m2rte.o "_g", referenced from: _plugin_init in m2rte.o "_plugin_default_version_check", referenced from: _plugin_init in m2rte.o "_register_callback", referenced from: _plugin_init in m2rte.o "_tree_code_length", referenced from: __ZN12_GLOBAL__N_130pass_warn_exception_inevitable7executeEP8function in m2rte.o "_tree_code_type", referenced from: __ZN12_GLOBAL__N_130pass_warn_exception_inevitable7executeEP8function in m2rte.o "_tree_contains_struct", referenced from: __ZN12_GLOBAL__N_130pass_warn_exception_inevitable7executeEP8function in m2rte.o ld: symbol(s) not found for architecture x86_64 collect2: error: ld returned 1 exit status make: *** [plugin/m2rte.so] Error 1 For one, the plugin may need to be linked with $(LIBINTL) (or not, don't know for certain). Besides, according to gcc/testsuite/lib/plugin-support.exp, the link needs to add -undefined dynamic_lookup