Subject: pkgsrc and name mangling of C++ compilers
To: None <tech-pkg@NetBSD.org>
From: Klaus Heinz <firstname.lastname@example.org>
Date: 04/26/2005 22:53:25
consider the following scenario:
Package A uses C++ and needs to be compiled with gcc>=3. It depends on
package B (providing some C++ functions) which can be compiled with
older gcc versions (eg 2.95).
On a NetBSD 1.6.2 system with gcc 2.95 as the native compiler, package
B will be compiled with this compiler, resulting in a library where
symbols follow the mangling scheme of gcc 2.95. Package A will be
compiled with gcc 3.3 and expects the functions from package B's
libraries to be mangled according to the gcc 3.3.x scheme.
Due to some stupid error checking in package A (like, none at all)
while trying to dlopen() the library in package B, I spent some hours
looking in the completely wrong direction :-/.
I am not aware of any mechanism in pkgsrc to ensure prerequisite
packages being compiled with a certain C++ compiler but I sure wish we
could do this somehow. A bulk build on NetBSD 1.6.x would not have caught
this error (remember, package A uses dlopen()).
I have the package building and working successfully but if it gets
committed as it is, it probably won't work on many NetBSD 1.6.2 systems.
Should/could we require all packages using C++ being compiled with the
same compiler version?