Index | Thread | Search

From:
Jeremie Courreges-Anglas <jca@wxcvbn.org>
Subject:
Re: [Re: mips64 bulk build report] unbreak devel/boost on octeon
To:
Klemens Nanni <kn@openbsd.org>
Cc:
ports <ports@openbsd.org>, Brad Smith <brad@comstyle.com>
Date:
Thu, 22 Jan 2026 16:41:26 +0100

Download raw body.

Thread
On Thu, Jan 22, 2026 at 03:35:41PM +0000, Klemens Nanni wrote:
> 22.01.2026 17:26, Jeremie Courreges-Anglas пишет:
> > boost publically exposes C++ libs with ABI details encoded.  That
> > doesn't work very well when mixing compilers.
> 
> Right.
> 
> > I suspect that passing
> > -mlong-calls to the b2 compilation (do-configure) should be enough,
> > but I'm not sure how to do that.
> 
> build.sh accepts flags, but then:
> 
> |clang++: warning: ignoring '-mlong-calls' option as it is not currently supported with the implicit usage of -mabicalls [-Woption-ignored]
> 
> ... second attempt, diff below:
> 
> |> clang++ -x c++ -std=c++11 -pthread -mlong-calls -mno-abicalls -Wno-deprecated-declarations -DNDEBUG bindjam.cpp [...] -o b2
> |fatal error: error in backend: Cannot select: 0x45fc4c9a0: i64 = MipsISD::GPRel TargetGlobalAddress:i64<ptr @.str> 0 [TF=3]
> |  0x442ad8ee0: i64 = TargetGlobalAddress<ptr @.str> 0 [TF=3]
> |In function: _ZN2b23jam6to_jamIbEEPNS_5valueET_
> |[...]

Pfff... so either there's a magic trick we don't know, or -mlong-calls
is plain useless with clang.

> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/devel/boost/Makefile,v
> diff -u -p -r1.157 Makefile
> --- Makefile	15 Jan 2026 15:00:58 -0000	1.157
> +++ Makefile	22 Jan 2026 15:30:46 -0000
> @@ -90,13 +90,15 @@ LIB_DEPENDS=	archivers/bzip2 \
>  
>  LIB_DEPENDS-md=	devel/boost
>  
> +BUILD_SH_ARGS=	# empty
> +.if ${MACHINE_ARCH} == "mips64"
> +# XXX bindjam.cpp:(.text+0x600): relocation truncated to fit: R_MIPS_CALL16 ...
> +BUILD_SH_ARGS+=	--cxxflags='-mlong-calls -mno-abicalls'
> +.endif
> +
>  .include <bsd.port.arch.mk>
>  
> -.if ${PROPERTIES:Mclang}
> -TOOLSET=	clang
> -.else
> -TOOLSET=	gcc
> -.endif
> +TOOLSET=	${CHOSEN_COMPILER:base-%=:ports-%=}

FWIW I'm really not a fan of these chicken scratches...

>  BJAM_CONFIG=	-sICU_PATH=${LOCALBASE} \
>  		-sBZIP2_INCLUDE=${LOCALBASE}/include \
> @@ -138,7 +140,7 @@ do-configure:
>  	@cd ${WRKSRC}/libs/config && \
>  		${SETENV} ${CONFIGURE_ENV} /bin/sh ./configure
>  	@cd ${WRKSRC}/tools/build/src/engine && ${SETENV} ${CONFIGURE_ENV} \
> -		/bin/sh ./build.sh ${TOOLSET} && cp b2 ${WRKSRC}
> +		/bin/sh ./build.sh ${BUILD_SH_ARGS} ${TOOLSET} && cp b2 ${WRKSRC}
>  	@cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} /bin/sh ./bootstrap.sh ${BOOTSTRAP}
>  
>  do-build:
> 

-- 
jca