On Mon, Aug 31, 2026 at 09:05:38PM +0100, Joerg Sonnenberger wrote:
> On 8/31/26 8:10 PM, Thomas Klausner wrote:
> > In 11.99.8/x86_64, ld supports the --as-needed flag.
> > gcc 16 sees this and wants to use this. gcc changelog entry:
>
> --as-needed has been used in various places for a decade at least. What is
> the actual command run, i.e. gcc -v output?
The compilation is not the problem, runtime is.
# sh compile.sh
Using built-in specs.
COLLECT_GCC=/tmp/editors/emacs31/work/.gcc/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/lto-wrapper
Target: x86_64--netbsd
Configured with: /usr/src/tools/gcc/../../external/gpl3/gcc/dist/configure --target=x86_64--netbsd --enable-long-long --enable-threads --with-bugurl=http://www.NetBSD.org/support/send-pr.html --with-pkgversion='NetBSD nb2 20260118' --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-time=rt --enable-libstdcxx-threads --with-diagnostics-color=auto-if-env --with-tune=nocona --with-default-libstdcxx-abi=new --with-isl=/var/obj/mknative/amd64-x86_64/usr/src/tooldir.NetBSD-11.0_BETA-amd64 --with-mpc-lib=/var/obj/mknative/amd64-x86_64/usr/src/external/lgpl3/mpc/lib/libmpc --with-mpfr-lib=/var/obj/mknative/amd64-x86_64/usr/src/external/lgpl3/mpfr/lib/libmpfr --with-gmp-lib=/var/obj/mknative/amd64-x86_64/usr/src/external/lgpl3/gmp/lib/libgmp --with-mpc-include=/usr/src/external/lgpl3/mpc/dist/src --with-mpfr-include=/usr/src/external/lgpl3/mpfr/dist/src --with-gmp-include=/usr/src/external/lgpl3/gmp/lib/libgmp/arch/x86_64 --enable-tls --disable-multilib --disable-libstdcxx-pch --build=x86_64--netbsd --host=x86_64--netbsd --with-sysroot=/var/obj/mknative/amd64-x86_64/usr/src/destdir.amd64
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.3.0 (nb3 20260428)
COLLECT_GCC_OPTIONS='-fcommon' '-fstack-protector-all' '-D' '_FORTIFY_SOURCE=2' '-fPIC' '-std=gnu23' '-o' 'conftest' '-O2' '-g' '-fstack-clash-protection' '-I' '/tmp/editors/emacs31/work/.buildlink/include' '-I' '/tmp/editors/emacs31/work/.buildlink/include/libxml2' '-I' '/tmp/editors/emacs31/work/.buildlink/include/freetype2' '-I' '/tmp/editors/emacs31/work/.buildlink/include/glib-2.0' '-I' '/tmp/editors/emacs31/work/.buildlink/include/gio-unix-2.0' '-I' '/tmp/editors/emacs31/work/.buildlink/lib/glib-2.0/include' '-I' '/tmp/editors/emacs31/work/.buildlink/include/harfbuzz' '-I' '/tmp/editors/emacs31/work/.buildlink/include/libdrm' '-I' '/tmp/editors/emacs31/work/.buildlink/include/librsvg-2.0' '-I' '/tmp/editors/emacs31/work/.buildlink/include/gdk-pixbuf-2.0' '-I' '/tmp/editors/emacs31/work/.buildlink/include/cairo' '-I' '/tmp/editors/emacs31/work/.buildlink/include/pango-1.0' '-I' '/tmp/editors/emacs31/work/.buildlink/include/fribidi' '-D' '_POSIX_THREAD_SAFE_FUNCTIONS' '-D' '_REENTRANT' '-I' '/tmp/editors/emacs31/work/.buildlink/include/pixman-1' '-I' '/tmp/editors/emacs31/work/.buildlink/include/libpng16' '-pthread' '-D' '_POSIX_THREAD_SAFE_FUNCTIONS' '-D' '_REENTRANT' '-fno-tree-sra' '-D' 'TERMINFO' '-L/tmp/editors/emacs31/work/.buildlink/lib' '-pie' '-v' '-mtune=nocona' '-march=x86-64'
/usr/libexec/cc1 -quiet -v -I /tmp/editors/emacs31/work/.buildlink/include -I /tmp/editors/emacs31/work/.buildlink/include/libxml2 -I /tmp/editors/emacs31/work/.buildlink/include/freetype2 -I /tmp/editors/emacs31/work/.buildlink/include/glib-2.0 -I /tmp/editors/emacs31/work/.buildlink/include/gio-unix-2.0 -I /tmp/editors/emacs31/work/.buildlink/lib/glib-2.0/include -I /tmp/editors/emacs31/work/.buildlink/include/harfbuzz -I /tmp/editors/emacs31/work/.buildlink/include/libdrm -I /tmp/editors/emacs31/work/.buildlink/include/librsvg-2.0 -I /tmp/editors/emacs31/work/.buildlink/include/gdk-pixbuf-2.0 -I /tmp/editors/emacs31/work/.buildlink/include/cairo -I /tmp/editors/emacs31/work/.buildlink/include/pango-1.0 -I /tmp/editors/emacs31/work/.buildlink/include/fribidi -I /tmp/editors/emacs31/work/.buildlink/include/pixman-1 -I /tmp/editors/emacs31/work/.buildlink/include/libpng16 -D_REENTRANT -D_PTHREADS -D _FORTIFY_SOURCE=2 -D _POSIX_THREAD_SAFE_FUNCTIONS -D _REENTRANT -D _POSIX_THREAD_SAFE_FUNCTIONS -D _REENTRANT -D TERMINFO conftest.c -quiet -dumpbase conftest.c -dumpbase-ext .c -mtune=nocona -march=x86-64 -g -O2 -std=gnu23 -version -fcommon -fstack-protector-all -fPIC -fstack-clash-protection -fno-tree-sra -o /tmp//ccbxlFCh.s
GNU C23 (nb3 20260428) version 14.3.0 (x86_64--netbsd)
compiled by GNU C version 14.3.0, GMP version 6.2.1, MPFR version 4.2.1, MPC version 1.3.1, isl version isl-0.26-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
#include "..." search starts here:
#include <...> search starts here:
/tmp/editors/emacs31/work/.buildlink/include
/tmp/editors/emacs31/work/.buildlink/include/libxml2
/tmp/editors/emacs31/work/.buildlink/include/freetype2
/tmp/editors/emacs31/work/.buildlink/include/glib-2.0
/tmp/editors/emacs31/work/.buildlink/include/gio-unix-2.0
/tmp/editors/emacs31/work/.buildlink/lib/glib-2.0/include
/tmp/editors/emacs31/work/.buildlink/include/harfbuzz
/tmp/editors/emacs31/work/.buildlink/include/libdrm
/tmp/editors/emacs31/work/.buildlink/include/librsvg-2.0
/tmp/editors/emacs31/work/.buildlink/include/gdk-pixbuf-2.0
/tmp/editors/emacs31/work/.buildlink/include/cairo
/tmp/editors/emacs31/work/.buildlink/include/pango-1.0
/tmp/editors/emacs31/work/.buildlink/include/fribidi
/tmp/editors/emacs31/work/.buildlink/include/pixman-1
/tmp/editors/emacs31/work/.buildlink/include/libpng16
/usr/include/gcc-14
/usr/include
End of search list.
Compiler executable checksum: 1729ab41250d19402768f7b3746d85c7
COLLECT_GCC_OPTIONS='-fcommon' '-fstack-protector-all' '-D' '_FORTIFY_SOURCE=2' '-fPIC' '-std=gnu23' '-o' 'conftest' '-O2' '-g' '-fstack-clash-protection' '-I' '/tmp/editors/emacs31/work/.buildlink/include' '-I' '/tmp/editors/emacs31/work/.buildlink/include/libxml2' '-I' '/tmp/editors/emacs31/work/.buildlink/include/freetype2' '-I' '/tmp/editors/emacs31/work/.buildlink/include/glib-2.0' '-I' '/tmp/editors/emacs31/work/.buildlink/include/gio-unix-2.0' '-I' '/tmp/editors/emacs31/work/.buildlink/lib/glib-2.0/include' '-I' '/tmp/editors/emacs31/work/.buildlink/include/harfbuzz' '-I' '/tmp/editors/emacs31/work/.buildlink/include/libdrm' '-I' '/tmp/editors/emacs31/work/.buildlink/include/librsvg-2.0' '-I' '/tmp/editors/emacs31/work/.buildlink/include/gdk-pixbuf-2.0' '-I' '/tmp/editors/emacs31/work/.buildlink/include/cairo' '-I' '/tmp/editors/emacs31/work/.buildlink/include/pango-1.0' '-I' '/tmp/editors/emacs31/work/.buildlink/include/fribidi' '-D' '_POSIX_THREAD_SAFE_FUNCTIONS' '-D' '_REENTRANT' '-I' '/tmp/editors/emacs31/work/.buildlink/include/pixman-1' '-I' '/tmp/editors/emacs31/work/.buildlink/include/libpng16' '-pthread' '-D' '_POSIX_THREAD_SAFE_FUNCTIONS' '-D' '_REENTRANT' '-fno-tree-sra' '-D' 'TERMINFO' '-L/tmp/editors/emacs31/work/.buildlink/lib' '-pie' '-v' '-mtune=nocona' '-march=x86-64'
as -v -I /tmp/editors/emacs31/work/.buildlink/include -I /tmp/editors/emacs31/work/.buildlink/include/libxml2 -I /tmp/editors/emacs31/work/.buildlink/include/freetype2 -I /tmp/editors/emacs31/work/.buildlink/include/glib-2.0 -I /tmp/editors/emacs31/work/.buildlink/include/gio-unix-2.0 -I /tmp/editors/emacs31/work/.buildlink/lib/glib-2.0/include -I /tmp/editors/emacs31/work/.buildlink/include/harfbuzz -I /tmp/editors/emacs31/work/.buildlink/include/libdrm -I /tmp/editors/emacs31/work/.buildlink/include/librsvg-2.0 -I /tmp/editors/emacs31/work/.buildlink/include/gdk-pixbuf-2.0 -I /tmp/editors/emacs31/work/.buildlink/include/cairo -I /tmp/editors/emacs31/work/.buildlink/include/pango-1.0 -I /tmp/editors/emacs31/work/.buildlink/include/fribidi -I /tmp/editors/emacs31/work/.buildlink/include/pixman-1 -I /tmp/editors/emacs31/work/.buildlink/include/libpng16 --gdwarf-4 -o /tmp//ccDK54Mp.o /tmp//ccbxlFCh.s
GNU assembler version 2.46.0 (x86_64--netbsd) using BFD version (NetBSD Binutils nb1) 2.46.0.20260210
COMPILER_PATH=/usr/libexec/
LIBRARY_PATH=/usr/lib/
COLLECT_GCC_OPTIONS='-fcommon' '-fstack-protector-all' '-D' '_FORTIFY_SOURCE=2' '-fPIC' '-std=gnu23' '-o' 'conftest' '-O2' '-g' '-fstack-clash-protection' '-I' '/tmp/editors/emacs31/work/.buildlink/include' '-I' '/tmp/editors/emacs31/work/.buildlink/include/libxml2' '-I' '/tmp/editors/emacs31/work/.buildlink/include/freetype2' '-I' '/tmp/editors/emacs31/work/.buildlink/include/glib-2.0' '-I' '/tmp/editors/emacs31/work/.buildlink/include/gio-unix-2.0' '-I' '/tmp/editors/emacs31/work/.buildlink/lib/glib-2.0/include' '-I' '/tmp/editors/emacs31/work/.buildlink/include/harfbuzz' '-I' '/tmp/editors/emacs31/work/.buildlink/include/libdrm' '-I' '/tmp/editors/emacs31/work/.buildlink/include/librsvg-2.0' '-I' '/tmp/editors/emacs31/work/.buildlink/include/gdk-pixbuf-2.0' '-I' '/tmp/editors/emacs31/work/.buildlink/include/cairo' '-I' '/tmp/editors/emacs31/work/.buildlink/include/pango-1.0' '-I' '/tmp/editors/emacs31/work/.buildlink/include/fribidi' '-D' '_POSIX_THREAD_SAFE_FUNCTIONS' '-D' '_REENTRANT' '-I' '/tmp/editors/emacs31/work/.buildlink/include/pixman-1' '-I' '/tmp/editors/emacs31/work/.buildlink/include/libpng16' '-pthread' '-D' '_POSIX_THREAD_SAFE_FUNCTIONS' '-D' '_REENTRANT' '-fno-tree-sra' '-D' 'TERMINFO' '-L/tmp/editors/emacs31/work/.buildlink/lib' '-pie' '-v' '-mtune=nocona' '-march=x86-64' '-dumpdir' 'conftest.'
ld -plugin /usr/libexec/liblto_plugin.so -plugin-opt=/usr/libexec/lto-wrapper -plugin-opt=-fresolution=/tmp//ccfqpS7Q.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lpthread -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --eh-frame-hdr -dc -dp -e _start -pie -dynamic-linker /usr/libexec/ld.elf_so -pie -o conftest /usr/lib/crt0.o /usr/lib/crti.o /usr/lib/crtbeginS.o -L/tmp/editors/emacs31/work/.buildlink/lib -rpath /usr/pkg/gcc16/lib -zrelro -znow -rpath /usr/pkg/lib /tmp//ccDK54Mp.o -lgccjit -lsqlite3 -lX11 -rpath /usr/pkg/lib -lcairo --as-needed -lgcc_s --no-as-needed -lgcc -lpthread -lc --as-needed -lgcc_s --no-as-needed -lgcc /usr/lib/crtendS.o /usr/lib/crtn.o
ld: /usr/lib/libm.so.0: warning: warning: reference to compatibility cabs()
ld: /usr/lib/libm.so.0: warning: warning: reference to compatibility cabsf()
COLLECT_GCC_OPTIONS='-fcommon' '-fstack-protector-all' '-D' '_FORTIFY_SOURCE=2' '-fPIC' '-std=gnu23' '-o' 'conftest' '-O2' '-g' '-fstack-clash-protection' '-I' '/tmp/editors/emacs31/work/.buildlink/include' '-I' '/tmp/editors/emacs31/work/.buildlink/include/libxml2' '-I' '/tmp/editors/emacs31/work/.buildlink/include/freetype2' '-I' '/tmp/editors/emacs31/work/.buildlink/include/glib-2.0' '-I' '/tmp/editors/emacs31/work/.buildlink/include/gio-unix-2.0' '-I' '/tmp/editors/emacs31/work/.buildlink/lib/glib-2.0/include' '-I' '/tmp/editors/emacs31/work/.buildlink/include/harfbuzz' '-I' '/tmp/editors/emacs31/work/.buildlink/include/libdrm' '-I' '/tmp/editors/emacs31/work/.buildlink/include/librsvg-2.0' '-I' '/tmp/editors/emacs31/work/.buildlink/include/gdk-pixbuf-2.0' '-I' '/tmp/editors/emacs31/work/.buildlink/include/cairo' '-I' '/tmp/editors/emacs31/work/.buildlink/include/pango-1.0' '-I' '/tmp/editors/emacs31/work/.buildlink/include/fribidi' '-D' '_POSIX_THREAD_SAFE_FUNCTIONS' '-D' '_REENTRANT' '-I' '/tmp/editors/emacs31/work/.buildlink/include/pixman-1' '-I' '/tmp/editors/emacs31/work/.buildlink/include/libpng16' '-pthread' '-D' '_POSIX_THREAD_SAFE_FUNCTIONS' '-D' '_REENTRANT' '-fno-tree-sra' '-D' 'TERMINFO' '-L/tmp/editors/emacs31/work/.buildlink/lib' '-pie' '-v' '-mtune=nocona' '-march=x86-64' '-dumpdir' 'conftest.'
# ./conftest
/usr/bin/ld: cannot find -lgcc_s_asneeded: No such file or directory
/usr/bin/ld: cannot find -lgcc_s_asneeded: No such file or directory
libgccjit.so: error: : error invoking gcc driver
You'll need gcc16-libjit-16.1.0 (before my commit from today that
bumped it to nb1) if you want to test it yourself.
For comparison, here's the output with gcc16-libjit-16.1.0nb1:
# sh compile.sh
Using built-in specs.
COLLECT_GCC=/tmp/editors/emacs31/work/.gcc/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/lto-wrapper
Target: x86_64--netbsd
Configured with: /usr/src/tools/gcc/../../external/gpl3/gcc/dist/configure --target=x86_64--netbsd --enable-long-long --enable-threads --with-bugurl=http://www.NetBSD.org/support/send-pr.html --with-pkgversion='NetBSD nb2 20260118' --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-time=rt --enable-libstdcxx-threads --with-diagnostics-color=auto-if-env --with-tune=nocona --with-default-libstdcxx-abi=new --with-isl=/var/obj/mknative/amd64-x86_64/usr/src/tooldir.NetBSD-11.0_BETA-amd64 --with-mpc-lib=/var/obj/mknative/amd64-x86_64/usr/src/external/lgpl3/mpc/lib/libmpc --with-mpfr-lib=/var/obj/mknative/amd64-x86_64/usr/src/external/lgpl3/mpfr/lib/libmpfr --with-gmp-lib=/var/obj/mknative/amd64-x86_64/usr/src/external/lgpl3/gmp/lib/libgmp --with-mpc-include=/usr/src/external/lgpl3/mpc/dist/src --with-mpfr-include=/usr/src/external/lgpl3/mpfr/dist/src --with-gmp-include=/usr/src/external/lgpl3/gmp/lib/libgmp/arch/x86_64 --enable-tls --disable-multilib --disable-libstdcxx-pch --build=x86_64--netbsd --host=x86_64--netbsd --with-sysroot=/var/obj/mknative/amd64-x86_64/usr/src/destdir.amd64
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.3.0 (nb3 20260428)
COLLECT_GCC_OPTIONS='-fcommon' '-fstack-protector-all' '-D' '_FORTIFY_SOURCE=2' '-fPIC' '-std=gnu23' '-o' 'conftest' '-O2' '-g' '-fstack-clash-protection' '-I' '/tmp/editors/emacs31/work/.buildlink/include' '-I' '/tmp/editors/emacs31/work/.buildlink/include/libxml2' '-I' '/tmp/editors/emacs31/work/.buildlink/include/freetype2' '-I' '/tmp/editors/emacs31/work/.buildlink/include/glib-2.0' '-I' '/tmp/editors/emacs31/work/.buildlink/include/gio-unix-2.0' '-I' '/tmp/editors/emacs31/work/.buildlink/lib/glib-2.0/include' '-I' '/tmp/editors/emacs31/work/.buildlink/include/harfbuzz' '-I' '/tmp/editors/emacs31/work/.buildlink/include/libdrm' '-I' '/tmp/editors/emacs31/work/.buildlink/include/librsvg-2.0' '-I' '/tmp/editors/emacs31/work/.buildlink/include/gdk-pixbuf-2.0' '-I' '/tmp/editors/emacs31/work/.buildlink/include/cairo' '-I' '/tmp/editors/emacs31/work/.buildlink/include/pango-1.0' '-I' '/tmp/editors/emacs31/work/.buildlink/include/fribidi' '-D' '_POSIX_THREAD_SAFE_FUNCTIONS' '-D' '_REENTRANT' '-I' '/tmp/editors/emacs31/work/.buildlink/include/pixman-1' '-I' '/tmp/editors/emacs31/work/.buildlink/include/libpng16' '-pthread' '-D' '_POSIX_THREAD_SAFE_FUNCTIONS' '-D' '_REENTRANT' '-fno-tree-sra' '-D' 'TERMINFO' '-L/tmp/editors/emacs31/work/.buildlink/lib' '-pie' '-v' '-mtune=nocona' '-march=x86-64'
/usr/libexec/cc1 -quiet -v -I /tmp/editors/emacs31/work/.buildlink/include -I /tmp/editors/emacs31/work/.buildlink/include/libxml2 -I /tmp/editors/emacs31/work/.buildlink/include/freetype2 -I /tmp/editors/emacs31/work/.buildlink/include/glib-2.0 -I /tmp/editors/emacs31/work/.buildlink/include/gio-unix-2.0 -I /tmp/editors/emacs31/work/.buildlink/lib/glib-2.0/include -I /tmp/editors/emacs31/work/.buildlink/include/harfbuzz -I /tmp/editors/emacs31/work/.buildlink/include/libdrm -I /tmp/editors/emacs31/work/.buildlink/include/librsvg-2.0 -I /tmp/editors/emacs31/work/.buildlink/include/gdk-pixbuf-2.0 -I /tmp/editors/emacs31/work/.buildlink/include/cairo -I /tmp/editors/emacs31/work/.buildlink/include/pango-1.0 -I /tmp/editors/emacs31/work/.buildlink/include/fribidi -I /tmp/editors/emacs31/work/.buildlink/include/pixman-1 -I /tmp/editors/emacs31/work/.buildlink/include/libpng16 -D_REENTRANT -D_PTHREADS -D _FORTIFY_SOURCE=2 -D _POSIX_THREAD_SAFE_FUNCTIONS -D _REENTRANT -D _POSIX_THREAD_SAFE_FUNCTIONS -D _REENTRANT -D TERMINFO conftest.c -quiet -dumpbase conftest.c -dumpbase-ext .c -mtune=nocona -march=x86-64 -g -O2 -std=gnu23 -version -fcommon -fstack-protector-all -fPIC -fstack-clash-protection -fno-tree-sra -o /tmp//cc5u6R19.s
GNU C23 (nb3 20260428) version 14.3.0 (x86_64--netbsd)
compiled by GNU C version 14.3.0, GMP version 6.2.1, MPFR version 4.2.1, MPC version 1.3.1, isl version isl-0.26-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
#include "..." search starts here:
#include <...> search starts here:
/tmp/editors/emacs31/work/.buildlink/include
/tmp/editors/emacs31/work/.buildlink/include/libxml2
/tmp/editors/emacs31/work/.buildlink/include/freetype2
/tmp/editors/emacs31/work/.buildlink/include/glib-2.0
/tmp/editors/emacs31/work/.buildlink/include/gio-unix-2.0
/tmp/editors/emacs31/work/.buildlink/lib/glib-2.0/include
/tmp/editors/emacs31/work/.buildlink/include/harfbuzz
/tmp/editors/emacs31/work/.buildlink/include/libdrm
/tmp/editors/emacs31/work/.buildlink/include/librsvg-2.0
/tmp/editors/emacs31/work/.buildlink/include/gdk-pixbuf-2.0
/tmp/editors/emacs31/work/.buildlink/include/cairo
/tmp/editors/emacs31/work/.buildlink/include/pango-1.0
/tmp/editors/emacs31/work/.buildlink/include/fribidi
/tmp/editors/emacs31/work/.buildlink/include/pixman-1
/tmp/editors/emacs31/work/.buildlink/include/libpng16
/usr/include/gcc-14
/usr/include
End of search list.
Compiler executable checksum: 1729ab41250d19402768f7b3746d85c7
COLLECT_GCC_OPTIONS='-fcommon' '-fstack-protector-all' '-D' '_FORTIFY_SOURCE=2' '-fPIC' '-std=gnu23' '-o' 'conftest' '-O2' '-g' '-fstack-clash-protection' '-I' '/tmp/editors/emacs31/work/.buildlink/include' '-I' '/tmp/editors/emacs31/work/.buildlink/include/libxml2' '-I' '/tmp/editors/emacs31/work/.buildlink/include/freetype2' '-I' '/tmp/editors/emacs31/work/.buildlink/include/glib-2.0' '-I' '/tmp/editors/emacs31/work/.buildlink/include/gio-unix-2.0' '-I' '/tmp/editors/emacs31/work/.buildlink/lib/glib-2.0/include' '-I' '/tmp/editors/emacs31/work/.buildlink/include/harfbuzz' '-I' '/tmp/editors/emacs31/work/.buildlink/include/libdrm' '-I' '/tmp/editors/emacs31/work/.buildlink/include/librsvg-2.0' '-I' '/tmp/editors/emacs31/work/.buildlink/include/gdk-pixbuf-2.0' '-I' '/tmp/editors/emacs31/work/.buildlink/include/cairo' '-I' '/tmp/editors/emacs31/work/.buildlink/include/pango-1.0' '-I' '/tmp/editors/emacs31/work/.buildlink/include/fribidi' '-D' '_POSIX_THREAD_SAFE_FUNCTIONS' '-D' '_REENTRANT' '-I' '/tmp/editors/emacs31/work/.buildlink/include/pixman-1' '-I' '/tmp/editors/emacs31/work/.buildlink/include/libpng16' '-pthread' '-D' '_POSIX_THREAD_SAFE_FUNCTIONS' '-D' '_REENTRANT' '-fno-tree-sra' '-D' 'TERMINFO' '-L/tmp/editors/emacs31/work/.buildlink/lib' '-pie' '-v' '-mtune=nocona' '-march=x86-64'
as -v -I /tmp/editors/emacs31/work/.buildlink/include -I /tmp/editors/emacs31/work/.buildlink/include/libxml2 -I /tmp/editors/emacs31/work/.buildlink/include/freetype2 -I /tmp/editors/emacs31/work/.buildlink/include/glib-2.0 -I /tmp/editors/emacs31/work/.buildlink/include/gio-unix-2.0 -I /tmp/editors/emacs31/work/.buildlink/lib/glib-2.0/include -I /tmp/editors/emacs31/work/.buildlink/include/harfbuzz -I /tmp/editors/emacs31/work/.buildlink/include/libdrm -I /tmp/editors/emacs31/work/.buildlink/include/librsvg-2.0 -I /tmp/editors/emacs31/work/.buildlink/include/gdk-pixbuf-2.0 -I /tmp/editors/emacs31/work/.buildlink/include/cairo -I /tmp/editors/emacs31/work/.buildlink/include/pango-1.0 -I /tmp/editors/emacs31/work/.buildlink/include/fribidi -I /tmp/editors/emacs31/work/.buildlink/include/pixman-1 -I /tmp/editors/emacs31/work/.buildlink/include/libpng16 --gdwarf-4 -o /tmp//ccGeS23j.o /tmp//cc5u6R19.s
GNU assembler version 2.46.0 (x86_64--netbsd) using BFD version (NetBSD Binutils nb1) 2.46.0.20260210
COMPILER_PATH=/usr/libexec/
LIBRARY_PATH=/usr/lib/
COLLECT_GCC_OPTIONS='-fcommon' '-fstack-protector-all' '-D' '_FORTIFY_SOURCE=2' '-fPIC' '-std=gnu23' '-o' 'conftest' '-O2' '-g' '-fstack-clash-protection' '-I' '/tmp/editors/emacs31/work/.buildlink/include' '-I' '/tmp/editors/emacs31/work/.buildlink/include/libxml2' '-I' '/tmp/editors/emacs31/work/.buildlink/include/freetype2' '-I' '/tmp/editors/emacs31/work/.buildlink/include/glib-2.0' '-I' '/tmp/editors/emacs31/work/.buildlink/include/gio-unix-2.0' '-I' '/tmp/editors/emacs31/work/.buildlink/lib/glib-2.0/include' '-I' '/tmp/editors/emacs31/work/.buildlink/include/harfbuzz' '-I' '/tmp/editors/emacs31/work/.buildlink/include/libdrm' '-I' '/tmp/editors/emacs31/work/.buildlink/include/librsvg-2.0' '-I' '/tmp/editors/emacs31/work/.buildlink/include/gdk-pixbuf-2.0' '-I' '/tmp/editors/emacs31/work/.buildlink/include/cairo' '-I' '/tmp/editors/emacs31/work/.buildlink/include/pango-1.0' '-I' '/tmp/editors/emacs31/work/.buildlink/include/fribidi' '-D' '_POSIX_THREAD_SAFE_FUNCTIONS' '-D' '_REENTRANT' '-I' '/tmp/editors/emacs31/work/.buildlink/include/pixman-1' '-I' '/tmp/editors/emacs31/work/.buildlink/include/libpng16' '-pthread' '-D' '_POSIX_THREAD_SAFE_FUNCTIONS' '-D' '_REENTRANT' '-fno-tree-sra' '-D' 'TERMINFO' '-L/tmp/editors/emacs31/work/.buildlink/lib' '-pie' '-v' '-mtune=nocona' '-march=x86-64' '-dumpdir' 'conftest.'
ld -plugin /usr/libexec/liblto_plugin.so -plugin-opt=/usr/libexec/lto-wrapper -plugin-opt=-fresolution=/tmp//ccb36Y8U.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lpthread -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --eh-frame-hdr -dc -dp -e _start -pie -dynamic-linker /usr/libexec/ld.elf_so -pie -o conftest /usr/lib/crt0.o /usr/lib/crti.o /usr/lib/crtbeginS.o -L/tmp/editors/emacs31/work/.buildlink/lib -rpath /usr/pkg/gcc16/lib -zrelro -znow -rpath /usr/pkg/lib /tmp//ccGeS23j.o -lgccjit -lsqlite3 -lX11 -rpath /usr/pkg/lib -lcairo --as-needed -lgcc_s --no-as-needed -lgcc -lpthread -lc --as-needed -lgcc_s --no-as-needed -lgcc /usr/lib/crtendS.o /usr/lib/crtn.o
ld: /usr/lib/libm.so.0: warning: warning: reference to compatibility cabs()
ld: /usr/lib/libm.so.0: warning: warning: reference to compatibility cabsf()
COLLECT_GCC_OPTIONS='-fcommon' '-fstack-protector-all' '-D' '_FORTIFY_SOURCE=2' '-fPIC' '-std=gnu23' '-o' 'conftest' '-O2' '-g' '-fstack-clash-protection' '-I' '/tmp/editors/emacs31/work/.buildlink/include' '-I' '/tmp/editors/emacs31/work/.buildlink/include/libxml2' '-I' '/tmp/editors/emacs31/work/.buildlink/include/freetype2' '-I' '/tmp/editors/emacs31/work/.buildlink/include/glib-2.0' '-I' '/tmp/editors/emacs31/work/.buildlink/include/gio-unix-2.0' '-I' '/tmp/editors/emacs31/work/.buildlink/lib/glib-2.0/include' '-I' '/tmp/editors/emacs31/work/.buildlink/include/harfbuzz' '-I' '/tmp/editors/emacs31/work/.buildlink/include/libdrm' '-I' '/tmp/editors/emacs31/work/.buildlink/include/librsvg-2.0' '-I' '/tmp/editors/emacs31/work/.buildlink/include/gdk-pixbuf-2.0' '-I' '/tmp/editors/emacs31/work/.buildlink/include/cairo' '-I' '/tmp/editors/emacs31/work/.buildlink/include/pango-1.0' '-I' '/tmp/editors/emacs31/work/.buildlink/include/fribidi' '-D' '_POSIX_THREAD_SAFE_FUNCTIONS' '-D' '_REENTRANT' '-I' '/tmp/editors/emacs31/work/.buildlink/include/pixman-1' '-I' '/tmp/editors/emacs31/work/.buildlink/include/libpng16' '-pthread' '-D' '_POSIX_THREAD_SAFE_FUNCTIONS' '-D' '_REENTRANT' '-fno-tree-sra' '-D' 'TERMINFO' '-L/tmp/editors/emacs31/work/.buildlink/lib' '-pie' '-v' '-mtune=nocona' '-march=x86-64' '-dumpdir' 'conftest.'
# ./conftest
#
The compilation output is basically the same. So there difference
must be in the libjit so file.
strings(1) on the two so files gives me, for the old one:
...
set_static_spec
}}}}}
%{!shared:
-lgcc_s
_asneeded}%{shared-libgcc:
Using built-in specs.
...
and for the new one:
...
set_static_spec
}}}}}
%{!shared:
-lgcc_s
--pop-state}%{shared-libgcc:
--push-state --as-needed
Using built-in specs.
...
I don't know how to extract this information in a better way, is there
one?
Thomas
#include <libgccjit.h>
#include <stdlib.h>
#include <stdio.h>
int
main (int argc, char **argv)
{
gcc_jit_context *ctxt;
gcc_jit_result *result;
ctxt = gcc_jit_context_acquire ();
if (!ctxt)
exit (1);
gcc_jit_type *int_type =
gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_INT);
gcc_jit_function *func =
gcc_jit_context_new_function (ctxt, NULL,
GCC_JIT_FUNCTION_EXPORTED,
int_type, "foo", 0, NULL, 0);
gcc_jit_block *block = gcc_jit_function_new_block (func, "foo");
gcc_jit_block_end_with_return (
block,
NULL,
gcc_jit_context_new_rvalue_from_int (ctxt, int_type, 1));
result = gcc_jit_context_compile (ctxt);
if (!result)
exit (1);
typedef int (*fn_type) (void);
fn_type foo =
(fn_type)gcc_jit_result_get_code (result, "foo");
if (!foo)
exit (1);
if (foo () != 1)
exit (1);
gcc_jit_context_release (ctxt);
gcc_jit_result_release (result);
return 0;
}
Attachment:
compile.sh
Description: Bourne shell script