Closed GoogleCodeExporter closed 9 years ago
ORIGINAL COMMENT FROM nieklinnenbank
I've discovered that the problem disappears whenever extern "C++" surrounds the
template classes, as described in this post:
http://marc.info/?l=netbsd-users&m=113515650400459&w=2
Original comment by coenbijlsma
on 7 Aug 2009 at 11:00
ORIGINAL COMMENT FROM nieklinnenbank
At this point I managed to successfully compile AND boot an ISO build on
OpenBSD 4.5.
To solve the template with C linkage problem, we should replace -isystem with
-I on
OpenBSD, as -isystem
seems to mark files included by -isystem as C files instead of C++ files, but -I
doesn't. It should be safe
to use -I instead of -isystem, as we pass -nostdinc to g++. This behaviour
currently
happens on all available
compilers on OpenBSD 4.5 (3.3.5 and 4.2.0 20070307).
Another problem with OpenBSD 4.5 is that, it doesn't allow the constructor
attribute,
with a priority
argument like this: __attribute__((constructor(65535))). We need this, as for
example
the ELF binary executable
format class needs to register itself to ExecutableFormat::formats, but AFTER
the
List() class constructor has run.
Otherwise, the pointer ELF had inserted would just be cleared to zero. To try
out if
the ISO compiled on OpenBSD 4.5
is bootable, I've temporarily hardcoded ELF::__register_ELFdetect() in
sbin/img/Main.cpp.
Original comment by coenbijlsma
on 7 Aug 2009 at 11:00
ORIGINAL COMMENT FROM nieklinnenbank
I've modified libexec to explicitely add ELF::detect to the formats list. The
system can now be compiled successfully on OpenBSD 4.5, and the ISO is correctly
bootable.
Original comment by coenbijlsma
on 7 Aug 2009 at 11:00
Original issue reported on code.google.com by
coenbijlsma
on 7 Aug 2009 at 11:00