Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Jan 2024 07:16:51 -0500
From:      mike tancsa <mike@sentex.net>
To:        Antoine Brodin <antoine@freebsd.org>
Cc:        Dimitry Andric <dim@freebsd.org>, FreeBSD-STABLE Mailing List <freebsd-stable@freebsd.org>
Subject:   Re: clang 17 and ports fallout
Message-ID:  <20ceec23-fe90-41de-a3d8-82eada0d56e7@sentex.net>
In-Reply-To: <CAALwa8=YiNqw0qJ6fWush%2BkHmTd1T8TEMFSsfUq29u8VZWa55w@mail.gmail.com>
References:  <06381879-c328-4051-bb2f-9c3620d90fa0@sentex.net> <4a0db68d-bb13-4238-a251-74d02ff14a17@sentex.net> <D365EB02-14AC-4F85-B687-962C20A7BA04@FreeBSD.org> <04837a47-a39c-40c5-a045-2d27fb3893ac@sentex.net> <CAALwa8=YiNqw0qJ6fWush%2BkHmTd1T8TEMFSsfUq29u8VZWa55w@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------TmukDo5Aa3rYMdeA1hJHI5Da
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

On 1/10/2024 2:53 AM, Antoine Brodin wrote:
> The preferred way is fixing the port by removing the undefined symbols
>> from the linker version script in the port, but if that is not possible
>> or difficult, add -Wl,--undefined-version to the linker flags suppresses
>> the error. E.g. in the port Makefile:
>>
>> LDFLAGS+= -Wl,--undefined-version
>>
>> For an example, see:
>>
>> https://github.com/freebsd/freebsd-ports/commit/37790b26cbda11cd4bb6f237b86cd94739c4059c
>>
>> Thanks very much!  That did indeed fix databases/rrdtool and and sysutils/flashrom builds.   What is the best way to flag any such issues ? Just open a PR for each individual port ?
> Hello,
>
> databases/rrdtool builds fine on stable/13 here:
> https://pkg-status.freebsd.org/gohan04/data/stable13amd64-default-foo/2024-01-09_21h18m24s/logs/rrdtool-1.8.0_2.log
>
I am not sure why it fails for me both in poudrier and outside it. But 
the same type of error as

https://pkg-status.freebsd.org/gohan04/data/stable13amd64-default-foo/2024-01-09_21h18m24s/logs/errors/ivykis-0.42.4.log

and adding

LDFLAGS+= -Wl,--undefined-version

fixes it for me

I just checked on releng_14 that also has clang 17 MFCd and I get the 
same error on the port. I am building it with less features than the 
default so not sure if that makes it fail in my environment. However the 
same options work with clang16

/usr/local/lib  -L/usr/local/lib  -o rrdupdate rrdupdate.o librrdupd.la
libtool: link: cc -O2 -pipe -fstack-protector-strong -isystem 
/usr/local/include -fno-strict-aliasing -D_GNU_SOURCE 
-fno-strict-aliasing -Wall -std=gnu99 -pedantic -Wundef -Wshadow 
-Wpointer-arith -Wcast-align -Wmissing-prototypes -Wmissing-declarations 
-Wnested-externs -Winline -Wold-style-definition -W -I.. -O2 -pipe 
-fstack-protector-strong -isystem /usr/local/include 
-fno-strict-aliasing -D_GNU_SOURCE -fno-strict-aliasing -Wall -std=gnu99 
-pedantic -Wundef -Wshadow -Wpointer-arith -Wcast-align 
-Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline 
-Wold-style-definition -W -fstack-protector-strong -o rrdupdate 
rrdupdate.o  -L/usr/local/lib ./.libs/librrdupd.a -lm -lwrap -lglib-2.0 
-lintl -pthread
libtool: link: echo "{ global:" > .libs/librrd.so.8.3.0-ver
libtool: link:           sed -e "s|$|;|" < ./librrd.sym >> 
.libs/librrd.so.8.3.0-ver
libtool: link:   echo "local: *; };" >> .libs/librrd.so.8.3.0-ver
libtool: link: cc -shared  -fPIC -DPIC .libs/librrd_la-rrd_version.o 
.libs/librrd_la-rrd_last.o .libs/librrd_la-rrd_lastupdate.o 
.libs/librrd_la-rrd_first.o .libs/librrd_la-rrd_dump.o 
.libs/librrd_la-rrd_flushcached.o .libs/librrd_la-rrd_fetch.o 
.libs/librrd_la-rrd_fetch_cb.o .libs/librrd_la-rrd_resize.o 
.libs/librrd_la-rrd_tune.o .libs/librrd_la-rrd_list.o 
.libs/librrd_la-rrd_restore.o -Wl,--whole-archive ./.libs/librrdupd.a 
-Wl,--no-whole-archive -L/usr/local/lib -lglib-2.0 -lintl -lm -lwrap 
-lxml2  -O2 -fstack-protector-strong -pthread -O2 
-fstack-protector-strong -fstack-protector-strong -Wl,-rpath 
-Wl,/usr/local/lib   -pthread -Wl,-soname -Wl,librrd.so.8 
-Wl,-version-script -Wl,.libs/librrd.so.8.3.0-ver -o .libs/librrd.so.8.3.0
ld: error: version script assignment of 'global' to symbol 'rrd_graph' 
failed: symbol not defined
ld: error: version script assignment of 'global' to symbol 'rrd_graph_v' 
failed: symbol not defined
ld: error: version script assignment of 'global' to symbol 'rrd_lcd' 
failed: symbol not defined
ld: error: version script assignment of 'global' to symbol 
'rrd_reduce_data' failed: symbol not defined
ld: error: version script assignment of 'global' to symbol 'rrd_xport' 
failed: symbol not defined
cc: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[4]: *** [Makefile:773: librrd.la] Error 1
gmake[4]: Leaving directory 
'/usr/ports/databases/rrdtool/work/rrdtool-1.8.0/src'
gmake[3]: *** [Makefile:618: all] Error 2
gmake[3]: Leaving directory 
'/usr/ports/databases/rrdtool/work/rrdtool-1.8.0/src'
gmake[2]: *** [Makefile:504: all-recursive] Error 1
gmake[2]: Leaving directory 
'/usr/ports/databases/rrdtool/work/rrdtool-1.8.0'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/databases/rrdtool
*** Error code 1

Stop.
make: stopped in /usr/ports/databases/rrdtool
- 0 root@build14:/usr/ports/databases/rrdtool # uname -aK
FreeBSD build14.sentex.ca 14.0-STABLE FreeBSD 14.0-STABLE #0 
stable/14-009c8a3d2: Tue Jan  9 10:06:28 UTC 2024 
root@build14.sentex.ca:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64 
1400504
- 0 root@build14:/usr/ports/databases/rrdtool #

     ---Mike

--------------TmukDo5Aa3rYMdeA1hJHI5Da
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <div class="moz-cite-prefix">On 1/10/2024 2:53 AM, Antoine Brodin
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAALwa8=YiNqw0qJ6fWush+kHmTd1T8TEMFSsfUq29u8VZWa55w@mail.gmail.com"><span
      style="white-space: pre-wrap">The preferred way is fixing the port by removing the undefined symbols</span>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">from the linker version script in the port, but if that is not possible
or difficult, add -Wl,--undefined-version to the linker flags suppresses
the error. E.g. in the port Makefile:

LDFLAGS+= -Wl,--undefined-version

For an example, see:

<a class="moz-txt-link-freetext" href="https://github.com/freebsd/freebsd-ports/commit/37790b26cbda11cd4bb6f237b86cd94739c4059c">https://github.com/freebsd/freebsd-ports/commit/37790b26cbda11cd4bb6f237b86cd94739c4059c</a>;

Thanks very much!  That did indeed fix databases/rrdtool and and sysutils/flashrom builds.   What is the best way to flag any such issues ? Just open a PR for each individual port ?
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">
Hello,

databases/rrdtool builds fine on stable/13 here:
<a class="moz-txt-link-freetext" href="https://pkg-status.freebsd.org/gohan04/data/stable13amd64-default-foo/2024-01-09_21h18m24s/logs/rrdtool-1.8.0_2.log">https://pkg-status.freebsd.org/gohan04/data/stable13amd64-default-foo/2024-01-09_21h18m24s/logs/rrdtool-1.8.0_2.log</a>;

</pre>
    </blockquote>
    <p>I am not sure why it fails for me both in poudrier and outside
      it. But the same type of error as <br>
    </p>
    <p><a class="moz-txt-link-freetext" href="https://pkg-status.freebsd.org/gohan04/data/stable13amd64-default-foo/2024-01-09_21h18m24s/logs/errors/ivykis-0.42.4.log">https://pkg-status.freebsd.org/gohan04/data/stable13amd64-default-foo/2024-01-09_21h18m24s/logs/errors/ivykis-0.42.4.log</a></p>;
    <p>and adding <br>
    </p>
    <pre class="moz-quote-pre" wrap="">LDFLAGS+= -Wl,--undefined-version

</pre>
    <p>fixes it for me</p>
    <p>I just checked on releng_14 that also has clang 17 MFCd and I get
      the same error on the port. I am building it with less features
      than the default so not sure if that makes it fail in my
      environment. However the same options work with clang16<br>
    </p>
    <p>/usr/local/lib  -L/usr/local/lib  -o rrdupdate rrdupdate.o
      librrdupd.la <br>
      libtool: link: cc -O2 -pipe -fstack-protector-strong -isystem
      /usr/local/include -fno-strict-aliasing -D_GNU_SOURCE
      -fno-strict-aliasing -Wall -std=gnu99 -pedantic -Wundef -Wshadow
      -Wpointer-arith -Wcast-align -Wmissing-prototypes
      -Wmissing-declarations -Wnested-externs -Winline
      -Wold-style-definition -W -I.. -O2 -pipe -fstack-protector-strong
      -isystem /usr/local/include -fno-strict-aliasing -D_GNU_SOURCE
      -fno-strict-aliasing -Wall -std=gnu99 -pedantic -Wundef -Wshadow
      -Wpointer-arith -Wcast-align -Wmissing-prototypes
      -Wmissing-declarations -Wnested-externs -Winline
      -Wold-style-definition -W -fstack-protector-strong -o rrdupdate
      rrdupdate.o  -L/usr/local/lib ./.libs/librrdupd.a -lm -lwrap
      -lglib-2.0 -lintl -pthread<br>
      libtool: link: echo "{ global:" &gt; .libs/librrd.so.8.3.0-ver<br>
      libtool: link:           sed -e "s|$|;|" &lt; ./librrd.sym
      &gt;&gt; .libs/librrd.so.8.3.0-ver<br>
      libtool: link:   echo "local: *; };" &gt;&gt;
      .libs/librrd.so.8.3.0-ver<br>
      libtool: link: cc -shared  -fPIC -DPIC 
      .libs/librrd_la-rrd_version.o .libs/librrd_la-rrd_last.o
      .libs/librrd_la-rrd_lastupdate.o .libs/librrd_la-rrd_first.o
      .libs/librrd_la-rrd_dump.o .libs/librrd_la-rrd_flushcached.o
      .libs/librrd_la-rrd_fetch.o .libs/librrd_la-rrd_fetch_cb.o
      .libs/librrd_la-rrd_resize.o .libs/librrd_la-rrd_tune.o
      .libs/librrd_la-rrd_list.o .libs/librrd_la-rrd_restore.o 
      -Wl,--whole-archive ./.libs/librrdupd.a -Wl,--no-whole-archive 
      -L/usr/local/lib -lglib-2.0 -lintl -lm -lwrap -lxml2  -O2
      -fstack-protector-strong -pthread -O2 -fstack-protector-strong
      -fstack-protector-strong -Wl,-rpath -Wl,/usr/local/lib   -pthread
      -Wl,-soname -Wl,librrd.so.8 -Wl,-version-script
      -Wl,.libs/librrd.so.8.3.0-ver -o .libs/librrd.so.8.3.0<br>
      ld: error: version script assignment of 'global' to symbol
      'rrd_graph' failed: symbol not defined<br>
      ld: error: version script assignment of 'global' to symbol
      'rrd_graph_v' failed: symbol not defined<br>
      ld: error: version script assignment of 'global' to symbol
      'rrd_lcd' failed: symbol not defined<br>
      ld: error: version script assignment of 'global' to symbol
      'rrd_reduce_data' failed: symbol not defined<br>
      ld: error: version script assignment of 'global' to symbol
      'rrd_xport' failed: symbol not defined<br>
      cc: error: linker command failed with exit code 1 (use -v to see
      invocation)<br>
      gmake[4]: *** [Makefile:773: librrd.la] Error 1<br>
      gmake[4]: Leaving directory
      '/usr/ports/databases/rrdtool/work/rrdtool-1.8.0/src'<br>
      gmake[3]: *** [Makefile:618: all] Error 2<br>
      gmake[3]: Leaving directory
      '/usr/ports/databases/rrdtool/work/rrdtool-1.8.0/src'<br>
      gmake[2]: *** [Makefile:504: all-recursive] Error 1<br>
      gmake[2]: Leaving directory
      '/usr/ports/databases/rrdtool/work/rrdtool-1.8.0'<br>
      ===&gt; Compilation failed unexpectedly.<br>
      Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the
      failure to<br>
      the maintainer.<br>
      *** Error code 1<br>
      <br>
      Stop.<br>
      make[1]: stopped in /usr/ports/databases/rrdtool<br>
      *** Error code 1<br>
      <br>
      Stop.<br>
      make: stopped in /usr/ports/databases/rrdtool<br>
      - 0 root@build14:/usr/ports/databases/rrdtool # uname -aK<br>
      FreeBSD build14.sentex.ca 14.0-STABLE FreeBSD 14.0-STABLE #0
      stable/14-009c8a3d2: Tue Jan  9 10:06:28 UTC 2024    
      <a class="moz-txt-link-abbreviated" href="mailto:root@build14.sentex.ca:/usr/obj/usr/src/amd64.amd64/sys/GENERIC">root@build14.sentex.ca:/usr/obj/usr/src/amd64.amd64/sys/GENERIC</a>
      amd64 1400504<br>
      - 0 root@build14:/usr/ports/databases/rrdtool # <br>
    </p>
    <p>    ---Mike<br>
    </p>
    <blockquote type="cite"
cite="mid:CAALwa8=YiNqw0qJ6fWush+kHmTd1T8TEMFSsfUq29u8VZWa55w@mail.gmail.com">
      <pre class="moz-quote-pre" wrap="">
</pre>
    </blockquote>
  </body>
</html>

--------------TmukDo5Aa3rYMdeA1hJHI5Da--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20ceec23-fe90-41de-a3d8-82eada0d56e7>