https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123326

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I don't see how my patch could have changed anything, but I can't reproduce it
either on cfarm430,
../configure --enable-languages=c,c++ --enable-bootstrap --disable-nls
--disable-libssp --disable-multilib --without-libintl
gmake -j15 bootstrap
built there just fine with latest trunk.
FreeBSD does have nl_langinfo_l and config/iconv.m4 arranges to find libiconv
even in /usr/local/ and links libstdc++.so.6 against that.  For libstdc++.a,
not sure what arranges -liconv to be found and linked when linking e.g. with
-static-libstdc++.
libstdc++ doesn't have libstdc++.spec like other libraries.
But as I said,
/home/jakub/gcc/obj1/./prev-gcc/xg++ -B/home/jakub/gcc/obj1/./prev-gcc/
-B/usr/local/x86_64-unknown-freebsd16.0/bin/ -nostdinc++
-B/home/jakub/gcc/obj1/prev-x86_64-unknown-freebsd16.0/libstdc++-v3/src/.libs
-B/home/jakub/gcc/obj1/prev-x86_64-unknown-freebsd16.0/libstdc++-v3/libsupc++/.libs

-I/home/jakub/gcc/obj1/prev-x86_64-unknown-freebsd16.0/libstdc++-v3/include/x86_64-unknown-freebsd16.0
 -I/home/jakub/gcc/obj1/prev-x86_64-unknown-freebsd16.0/libstdc++-v3/include 
-I/home/jakub/gcc/libstdc++-v3/libsupc++
-L/home/jakub/gcc/obj1/prev-x86_64-unknown-freebsd16.0/libstdc++-v3/src/.libs
-L/home/jakub/gcc/obj1/prev-x86_64-unknown-freebsd16.0/libstdc++-v3/libsupc++/.libs
  -g -O2 -fno-checking -gtoggle -DIN_GCC    -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wno-error=narrowing -Wwrite-strings
-Wcast-qual -Wmissing-format-attribute -Wconditionally-supported
-Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros
-Wno-overlength-strings -Werror  -DHAVE_CONFIG_H  -DGENERATOR_FILE
-static-libstdc++ -static-libgcc  -o build/genpreds \
    build/genpreds.o build/rtl.o build/read-rtl.o build/ggc-none.o build/vec.o
build/min-insn-modes.o build/gensupport.o build/print-rtl.o build/hash-table.o
build/sort.o build/read-md.o build/errors.o .././libiberty/libiberty.a
links fine for me and no libiconv/libiconv_open/libiconv_close symbols appear
to it, so supposedly libstdc++.a(format.o) wasn't linked in (why would it be?).
When I link build/genpreds with additional
-Wl,--whole-archive
/home/jakub/gcc/obj1/prev-x86_64-unknown-freebsd16.0/libstdc++-v3/src/.libs/libstdc++.a
-Wl,--no-whole-archive
the link indeed fails with
ld: error: undefined symbol: libiconv_close
>>> referenced by format.cc:88 
>>> (../../../../../libstdc++-v3/src/c++20/format.cc:88)
>>>               format.o:(std::__format::(anonymous 
>>> namespace)::__encoding::~__encoding()) in archive 
>>> /home/jakub/gcc/obj1/prev-x86_64-unknown-freebsd16.0/libstdc++-v3/src/.libs/libstdc++.a
>>> referenced by format.cc:88 
>>> (../../../../../libstdc++-v3/src/c++20/format.cc:88)
>>>               format.o:(std::__format::(anonymous 
>>> namespace)::__encoding::~__encoding()) in archive 
>>> /home/jakub/gcc/obj1/prev-x86_64-unknown-freebsd16.0/libstdc++-v3/src/.libs/libstdc++.a

ld: error: undefined symbol: libiconv_open
>>> referenced by format.cc:79 
>>> (../../../../../libstdc++-v3/src/c++20/format.cc:79)
>>>               
>>> format.o:(std::__format::__with_encoding_conversion(std::locale const&)) in 
>>> archive 
>>> /home/jakub/gcc/obj1/prev-x86_64-unknown-freebsd16.0/libstdc++-v3/src/.libs/libstdc++.a

ld: error: undefined symbol: libiconv
>>> referenced by format.cc:118 
>>> (../../../../../libstdc++-v3/src/c++20/format.cc:118)
>>>               
>>> format.o:(std::__format::__locale_encoding_to_utf8(std::locale const&, 
>>> std::basic_string_view<char, std::char_traits<char>>, void*)) in archive 
>>> /home/jakub/gcc/obj1/prev-x86_64-unknown-freebsd16.0/libstdc++-v3/src/.libs/libstdc++.a
>>> referenced by format.cc:124 
>>> (../../../../../libstdc++-v3/src/c++20/format.cc:124)
>>>               
>>> format.o:(std::__format::__locale_encoding_to_utf8(std::locale const&, 
>>> std::basic_string_view<char, std::char_traits<char>>, void*)) in archive 
>>> /home/jakub/gcc/obj1/prev-x86_64-unknown-freebsd16.0/libstdc++-v3/src/.libs/libstdc++.a
collect2: error: ld returned 1 exit status
so guess some solution for the FreeBSD libiconv stuff is needed for static
linking of libstdc++, but I really don't see anything changed in that area by
my patch.

Reply via email to