[Bug 276035] net/mpich: ld: error: undefined reference due to --no-allow-shlib-undefined with clang-17

From: <bugzilla-noreply_at_freebsd.org>
Date: Sun, 31 Dec 2023 16:51:02 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=276035

Dimitry Andric <dim@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dim@FreeBSD.org
             Status|New                         |Open

--- Comment #2 from Dimitry Andric <dim@FreeBSD.org> ---
What happens is that clang 17 partially supports __float128 on x86_64, while
clang 16 did not.

The configure script under clang 16 shows:

configure:43831: checking size of __float128
configure:43836: clang15 -o conftest -I/usr/local/include/json-c
-I/usr/local/include/gcc12 -O2 -pipe  -fstack-protector-strong -isystem
/usr/local/include -fno-strict-aliasing    -isystem /usr/local/include
-I/usr/local/include -DNETMOD_INLINE=__netmod_inline_ofi__
-I/wrkdirs/usr/ports/net/mpich/work/mpich-4.1.2/src/mpl/include -D_REENTRANT
-I/wrkdirs/usr/ports/net/mpich/work/mpich-4.1.2/src/mpi/romio/include
-I/wrkdirs/usr/ports/net/mpich/work/mpich-4.1.2/src/pmi/include 
-L/usr/local/lib conftest.c -L/usr/local/lib -lepoll-shim -ljson-c -lm >&5
conftest.c:127:57: error: __float128 is not supported on this target
static long int longval () { return (long int) (sizeof (__float128)); }
                                                        ^
conftest.c:128:67: error: __float128 is not supported on this target
static unsigned long int ulongval () { return (long int) (sizeof (__float128));
}
                                                                  ^
conftest.c:138:28: error: __float128 is not supported on this target
  if (((long int) (sizeof (__float128))) < 0)
                           ^
conftest.c:141:37: error: __float128 is not supported on this target
      if (i != ((long int) (sizeof (__float128))))
                                    ^
conftest.c:148:37: error: __float128 is not supported on this target
      if (i != ((long int) (sizeof (__float128))))
                                    ^
5 errors generated.
configure:43836: $? = 1
configure: program exited with status 1

while with clang 17 you get:

configure:43831: checking size of __float128
configure:43836: cc -o conftest -I/usr/local/include/json-c
-I/usr/local/include/gcc12 -O2 -pipe  -fstack-protector-strong -isystem
/usr/local/include -fno-strict-aliasing    -isystem /usr/local/include
-I/usr/local/include -DNETMOD_INLINE=__netmod_inline_ofi__
-I/wrkdirs/usr/ports/net/mpich/work/mpich-4.1.2/src/mpl/include -D_REENTRANT
-I/wrkdirs/usr/ports/net/mpich/work/mpich-4.1.2/src/mpi/romio/include
-I/wrkdirs/usr/ports/net/mpich/work/mpich-4.1.2/src/pmi/include 
-L/usr/local/lib conftest.c -L/usr/local/lib -lepoll-shim -ljson-c -lm >&5
configure:43836: $? = 0
configure:43836: ./conftest
configure:43836: $? = 0
configure:43850: result: 16

So in src/include/mpichconf.h you then get:

/* Define if __float128 is supported */
#define HAVE_FLOAT128 1

which causes src/mpi/coll/op/opsum.c to emit calls to libgcc support functions
for float128 types, in particular:

* __addtf3
* __gttf2
* __lttf2
* __multf3
* __extendxftf2
* __trunctfxf2

Unfortunately not all these functions are available yet in compiler-rt. They
will be included when llvm-18 is imported.

For now, it is probably easiest to suppress float128 detection in the configure
script, for example by adding:

CONFIGURE_ENV+= ac_cv_sizeof___float128=0

just below CONFIGURE_ARGS in the Makefile.

-- 
You are receiving this mail because:
You are the assignee for the bug.