https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88238

--- Comment #1 from Iain Buclaw <ibuclaw at gdcproject dot org> ---
(In reply to Rainer Orth from comment #0)
> 
> which allow libgdruntime.so and libgphobos.so to link on Solaris 11.3 without
> unresolved symbols, there are more on Solaris 10:
> 
> * 
>       symbol not found: backtrace             
> (libdruntime/.libs/libgdruntime.so)
>       symbol not found: backtrace_symbols_fd          
> (libdruntime/.libs/libgdruntime.so)
>       symbol not found: backtrace_symbols             
> (libdruntime/.libs/libgdruntime.so)
> 
>   Unlike Solaris 11, Solaris 10 lacks the backtrace functions in libc.  When
>   trying to use them, this failed because backtrace-supported.h wasn't found 
>   during configure.  This is due to an error in m4/druntime/libraries.m4
> which
>   tries to add to CPPFLAGS with +=, which of course the shell doesn't
> understand.
> 

Just saw this, I noticed this also when building on one of the BSDs, fixed in
r270377.


> * 
> 
>       symbol not found: dl_iterate_phdr               
> (libdruntime/.libs/libgdruntime.so)
> 
>   Unlike Solaris 11, dl_iterate_phdr support was only backported to a late
>   Solaris 10 update and even so only lives in libdl, not in libc.  Not yet
>   fixed.
> 

So does dlopen and dl_iterate_phdr live in separate libraries?  I would have
thought that DRUNTIME_LIBRARIES_DLOPEN would correctly add -ldl to the driver
spec file.


> *
> 
>       symbol not found: getprogname           
> (libdruntime/.libs/libgdruntime.so)
> 
>   Solaris 10 lacks getprogname or equivalent; for now I'm faking this by just
>   returning "a.out".
> 

There's the following function in rt/dmain2.d

    extern (C) string[] rt_args();

Would the basename() of argv[0] be a suitable fallback?  Looking at illumos,
they use dlinfo(RTLD_SELF, RTLD_DI_ARGSINFO) and strrchr(argv0, '/').


> *
>         symbol not found: posix_memalign               
> (src/.libs/libgphobos.so)
> 
>   Also missing from Solaris 10.  I've not yet checked what to do here.  One
>   might be able to use pagealign_alloc from gnulib instead?

If the OS version can be obtained from the compiler, same as FBSD_MAJOR, then
one option would be to provide posix_memalign internally in druntime.

extern(D) int posix_memalign(void** ptr, size_t alignment, size_t size)
{
  // ...
}

extern(D) so that it won't conflict with extern(C) function of the same name.

Though whether it is worth the effort, I'm not so sure.  As you've said that
Solaris10 will be removed before.

Reply via email to