pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Imake on Solaris 11.2/sparc

On Wed, Jul 13, 2016 at 01:57:07PM +0200, J?rn Clausen wrote:
 > Linking fails with
 >  ld: fatal: /usr/lib/ld/map.noexdata: 29: error: SPARC Procedure Linkage
 > Table (PLT) must remain executable
 > The flag "-Wl,-M,/usr/lib/ld/map.noexdata" (which should not be used in
 > Sparc, only i86) comes from
 > #ifndef Mapfile_NoExData
 > # if defined(SparcArchitecture)
 > /* SPARC archictecture requires PLT section in .data be executable, so
 >    we can only make .bss, not all of .data no-exec on SPARC */
 > #   define Mapfile_NoExData /**/
 > # else
 > #  if OSMinorVersion >= 10
 > #   define Mapfile_NoExData $(MAPFILEFLAG)/usr/lib/ld/map.noexdata
 > #  else
 > #   define Mapfile_NoExData /**/
 > #  endif
 > # endif
 > #endif
 > The definition for SparcArchitecture seems okay, it boils down to the
 > presence of defines "sun" and "sparc", which my GCC emits.

It must not be getting set, though, because you're getting to the
wrong branch of the if.

My first guess would be that it isn't set yet where this logic is.
Probably something in the maze of includes is skipping something else
and that causes it to not include the SparcArchitecture definition
until later, or maybe never.

Debugging this kind of problem is a major pain... the best way to do
it IME is to dig up the actual cpp invocation so as to collect the cpp
output (this requires wading into imake, as imake is careful to
conceal both these things from the user) and then sticking extra
tokens into the template files to see what is and isn't reached and
where and in what order, and what's defined to what when doing so.

If you can check the exact differences in what the compiler predefines
between Solaris 10 sparc and Solaris 11 sparc that might help.

imake should be terminated. It is arguably less work to patch any one
package to not use it than to track down any one of these problems.

 > I noticed patch-ag in x11/xorg-cf-files:
 > -#ifdef sun
 > +#if defined(sun) || defined(__sun)
 > in Just for fun I reverted it back to the original, and voila,
 > now compilation of xdu succeeds (i.e. the linker flag is not included). But
 > installation then fails and the RUNPATH of the binary does not include the
 > pkgsrc directories for e.g. X11 libraries.

Yeah, letting it fail to notice it's not on Solaris isn't likely to
help :-/

David A. Holland

Home | Main Index | Thread Index | Old Index