NetBSD-Bugs archive

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

re: toolchain/40170: gcc -m32 issues with NEEDED



this patch fixes half of the problem -- making ld have the right
SEARCH_DIRS for the 32 bit scripts.  it's pretty ugly but i'm not
sure of a nicer way off hand.

it leaves the other half of the problem remaining, however, as
can be demonstrated by the pr40170.tar from jared.


.mrg.


Index: gnu/usr.bin/binutils/ld/Makefile
===================================================================
RCS file: /cvsroot/src/gnu/usr.bin/binutils/ld/Makefile,v
retrieving revision 1.27
diff -p -r1.27 Makefile
*** Makefile    13 Oct 2008 22:36:55 -0000      1.27
--- Makefile    15 Dec 2008 01:32:24 -0000
*************** ${PROG}.info: configdoc.texi
*** 74,86 ****
  DPSRCS+=      .depend.${f} e${f}.c
  CLEANFILES+=  .depend.${f} e${f}.c
  
  e${f}.c: ${DIST}/ld/genscripts.sh ${.CURDIR}/Makefile stringify.sed
        ${_MKTARGET_CREATE}
        unset MACHINE || true; \
!       LIB_PATH=/usr/lib
                ${HOST_SH} ${DIST}/ld/genscripts.sh ${DIST}/ld ${LIBDIR} "/usr" 
\
                ${G_target_alias} ${G_target_alias} ${G_target_alias} \
!               ${G_EMUL} ${LIBDIR} no ${f} "${G_target_alias}"
  
  .if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "sparc64"
  FILES+=               ${f}.x ${f}.xbn ${f}.xn ${f}.xr ${f}.xu
--- 74,97 ----
  DPSRCS+=      .depend.${f} e${f}.c
  CLEANFILES+=  .depend.${f} e${f}.c
  
+ EMUL_LIB_PATH:=/usr/lib
+ # XXX super hack
+ . if (${MACHINE_ARCH} == "x86_64" && \
+       (${f} == "elf_i386" || ${f} == "i386nbsd"))
+ EMUL_LIB_PATH:=/usr/lib/i386
+ . endif
+ . if (${MACHINE_ARCH} == "sparc64" && \
+       (${f} == "elf32_sparc " || ${f} == "sparcnbsd"))
+ EMUL_LIB_PATH:=/usr/lib/sparc
+ . endif
+ 
  e${f}.c: ${DIST}/ld/genscripts.sh ${.CURDIR}/Makefile stringify.sed
        ${_MKTARGET_CREATE}
        unset MACHINE || true; \
!       LIB_PATH=${EMUL_LIB_PATH} \
                ${HOST_SH} ${DIST}/ld/genscripts.sh ${DIST}/ld ${LIBDIR} "/usr" 
\
                ${G_target_alias} ${G_target_alias} ${G_target_alias} \
!               ${G_EMUL} ${LIBDIR} yes ${f} "${G_target_alias}"
  
  .if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "sparc64"
  FILES+=               ${f}.x ${f}.xbn ${f}.xn ${f}.xr ${f}.xu


Home | Main Index | Thread Index | Old Index