STR-672: strc: fix multiple external definitions problems
The following warnings are common:
I’m not 100% sure that this is a compiler problem, maybe it’s a problem with duplicate imports of signatures.
Submitted on 3 December 2006 at 14:49<tsuna> [ strc | info ] Compiling '../../../src/tools/pp-prism.str' <tsuna> [ strc | warning ] multiple external definitions with same signature <tsuna> [ExtSDef("FILE",[VarDec("g_13",FunType([ConstType(Sort("ATerm",[]))],ConstType(Sort("ATerm",[]))))],[]),ExtSDef("FILE",[VarDec("k_27",FunType([ConstType(Sort("ATerm",[]))],ConstType(Sort("ATerm",[]))))],[])] <tsuna> [ strc | warning ] multiple external definitions with same signature <tsuna> [ExtSDef("DIR",[VarDec("h_13",FunType([ConstType(Sort("ATerm",[]))],ConstType(Sort("ATerm",[]))))],[]),ExtSDef("DIR",[VarDec("l_27",FunType([ConstType(Sort("ATerm",[]))],ConstType(Sort("ATerm",[]))))],[])] <tsuna> [ strc | warning ] multiple external definitions with same signature <tsuna> [ExtSDef("TEMP",[],[]),ExtSDef("TEMP",[],[])] <tsuna> [ strc | warning ] multiple external definitions with same signature <tsuna> [ExtSDef("TempFiles",[],[]),ExtSDef("TempFiles",[],[])] <tsuna> [ strc | warning ] multiple external definitions with same signature <tsuna> [ExtSDef("TempDirs",[],[]),ExtSDef("TempDirs",[],[])] <tsuna> [ strc | warning ] multiple external definitions with same signature <tsuna> [ExtSDef("Tool",[VarDec("i_13",FunType([ConstType(Sort("ATerm",[]))],ConstType(Sort("ATerm",[]))))],[]),ExtSDef("Tool",[VarDec("m_27",FunType([ConstType(Sort("ATerm",[]))],ConstType(Sort("ATerm",[]))))],[])] <tsuna> [ strc | warning ] multiple external definitions with same signature <tsuna> [ExtSDef("Repository",[],[]),ExtSDef("Repository",[],[])] <tsuna> [ strc | warning ] multiple external definitions with same signature <tsuna> [ExtSDef("Import",[],[]),ExtSDef("Import",[],[])] <tsuna> [ strc | warning ] multiple external definitions with same signature <tsuna> [ExtSDef("Imported",[VarDec("j_13",FunType([ConstType(Sort("ATerm",[]))],ConstType(Sort("ATerm",[]))))],[]),ExtSDef("Imported",[VarDec("n_27",FunType([ConstType(Sort("ATerm",[]))],ConstType(Sort("ATerm",[]))))],[])] <tsuna> [ strc | warning ] multiple external definitions with same signature <tsuna> [ExtSDef("XTC",[],[]),ExtSDef("XTC",[],[])] <tsuna> [ strc | info ] Front-end succeeded : [user/system] = [3.58s/1.38s] <tsuna> [ strc | info ] Optimization succeeded -O 2 : [user/system] = [0.09s/0.02s] <tsuna> [ strc | info ] Back-end succeeded : [user/system] = [1.66s/0.10s] <tsuna> [ strc | info ] Compilation succeeded : [user/system] = [5.35s/1.51s] <tsuna> and then <tsuna> linking pp-prism leads to *tons* of warnings from ld such as: <tsuna> /usr/bin/ld: warning multiple definitions of symbol _FILE_1_0 <tsuna> /nix/store/9g6qzzmahjfh5p7hfpvc13anblkwvacb-strategoxt/lib/libstratego-gpp.dylib(libstratego_gpp_la-libstratego-gpp.o) definition of _FILE_1_0 <tsuna> /nix/store/9g6qzzmahjfh5p7hfpvc13anblkwvacb-strategoxt/lib/libstratego-xtc.dylib(libstratego_xtc_la-libstratego-xtc-posix-xsi.o) definition of _FILE_1_0 <tsuna> the following symbols are concerned: _FILE_1_0, _Import_0_0, _Import_1_0, _Repository_0_0, _TEMP_0_0, _TempDirs_0_0, _TempFiles_0_0, _Tool_1_0, _XTC_0_0, _DIR_1_0, _DYNAMIC__CALLS_0_0</verbatim>
Issue Log
STR-672, visser:
From the names of the strategies I guess these are congruence definitions. While proper strategy
definitions that are imported as externals are not exported as externals from a library, constructors
imported by a library, are also exported by that library. This causes congruences to be regenerated,
possibly not in that same library, but in a library one step further in the import chain.front/introduce-congdefs.str :
// avoid double definitions of congruences by registering already defined operators
Thus, the external definitions for congruences from an imported library, prevent generation of new congruences.
However, since imported external definitions are not exported, the next library does not see those congruence
definitions, and will re-generate them.What is needed is a distinction between internal and external constructor.
Or we should even not export imported constructors.
That requires a notion of external constructor definition.
STR-672, visser:
fixed by introducing external constructors (STR-751) and not exporting imported constructors from a library
Log in to post comments