You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ ./v -stats test vlib/encoding/iconv/
---- Testing... ----
================== C compilation error (from tcc): ==============
cc: tcc: error: undefined symbol 'libiconv_open'
cc: tcc: error: undefined symbol 'libiconv'
cc: tcc: error: undefined symbol 'libiconv_close'
=================================================================
(You can pass `-cg`, or `-show-c-output` as well, to print all the C error messages).
builder error:
==================
C error found. It should never happen, when compiling pure V code.
This is a V compiler bug, please report it using `v bug file.v`,
or goto https://github.com/vlang/v/issues/new/choose .
You can also use #help on Discord: https://discord.gg/vlang .
NOK Run encoding.iconv tests with gcc (egcc binary on OpenBSD)
./v -cc egcc -stats test vlib/encoding/iconv/
---- Testing... ----
builder error: Header file <iconv.h>, needed for module `encoding.iconv` was not found. Please install the corresponding development headers.
----
To reproduce just failure 1 run: '/home/fox/dev/vlang.git/v' -cc egcc -stats '/home/fox/dev/vlang.git/vlib/encoding/iconv/iconv_test.v'
Summary for all V _test.v files: 1 failed, 1 total. Elapsed time: 2111 ms, on 1 job. Comptime: 0 ms. Runtime: 2106 ms.
NOK Run encoding.iconv tests with clang
$ ./v -cc clang -stats test vlib/encoding/iconv/
---- Testing... ----
builder error: Header file <iconv.h>, needed for module `encoding.iconv` was not found. Please install the corresponding development headers.
----
To reproduce just failure 1 run: '/home/fox/dev/vlang.git/v' -cc clang -stats '/home/fox/dev/vlang.git/vlib/encoding/iconv/iconv_test.v'
Summary for all V _test.v files: 1 failed, 1 total. Elapsed time: 1519 ms, on 1 job. Comptime: 0 ms. Runtime: 1516 ms.
Expected Behavior
All tests OK for encoding.iconv with tcc, gcc and clang
Current Behavior
See above for test
WIth this issue, vdoctor does not work on OpenBSD current/amd64 with tcc, clang and gcc. With PR #23361vdoctor uses now iconv encoding for its output.
$ ./v doctor
cannot compile `/home/fox/dev/vlang.git/cmd/tools/vdoctor.v`: 1
tcc: error: undefined symbol 'libiconv_open'
tcc: error: undefined symbol 'libiconv'
tcc: error: undefined symbol 'libiconv_close'
builder error:
==================
C error found. It should never happen, when compiling pure V code.
This is a V compiler bug, please report it using `v bug file.v`,
or goto https://github.com/vlang/v/issues/new/choose .
You can also use #help on Discord: https://discord.gg/vlang .
Possible Solution
In vlib/encoding/iconv/iconv_nix.c.v file, add #flag for OpenBSD to find iconv includes and library.
I have this fix in my personal fork. I will post a PR with it.
Bug description
On OpenBSD current/amd64, tests for
vlib/encoding/iconv/
fail because the compiler is unable to find iconv includes (iconv.h
) or library.Same issue with tcc, gcc and clang.
Reproduction Steps
On OpenBSD current/amd64, iconv library is installed via
libiconv
(latest version = 1.17) package (pkg_add iconv
).Contents of
iconv
package with includes and librarypkg_info -L libiconv Information for inst:libiconv-1.17 Files: /usr/local/bin/iconv /usr/local/include/iconv.h /usr/local/include/libcharset.h /usr/local/include/localcharset.h /usr/local/lib/libcharset.a /usr/local/lib/libcharset.la /usr/local/lib/libcharset.so.1.1 /usr/local/lib/libiconv.a /usr/local/lib/libiconv.la /usr/local/lib/libiconv.so.7.1 /usr/local/man/man1/iconv.1 /usr/local/man/man3/iconv.3 /usr/local/man/man3/iconv_close.3 /usr/local/man/man3/iconv_open.3 /usr/local/man/man3/iconv_open_into.3 /usr/local/man/man3/iconvctl.3 /usr/local/share/doc/libiconv/iconv.1.html /usr/local/share/doc/libiconv/iconv.3.html /usr/local/share/doc/libiconv/iconv_close.3.html /usr/local/share/doc/libiconv/iconv_open.3.html /usr/local/share/doc/libiconv/iconv_open_into.3.html /usr/local/share/doc/libiconv/iconvctl.3.html
NOK Run
encoding.iconv
tests with tccNOK Run
encoding.iconv
tests with gcc (egcc
binary on OpenBSD)NOK Run
encoding.iconv
tests with clangExpected Behavior
All tests OK for
encoding.iconv
with tcc, gcc and clangCurrent Behavior
See above for test
WIth this issue,
vdoctor
does not work on OpenBSD current/amd64 with tcc, clang and gcc. With PR #23361vdoctor
uses now iconv encoding for its output.Possible Solution
In
vlib/encoding/iconv/iconv_nix.c.v
file, add#flag
for OpenBSD to find iconv includes and library.I have this fix in my personal fork. I will post a PR with it.
Additional Information/Context
No response
V version
V 0.4.9 5be2fca
Environment details (OS name and version, etc.)
OpenBSD current/amd64
tcc built for OpenBSD from https://github.com/vlang/tccbin repository
gcc version 11.2.0
$ egcc -v Using built-in specs. COLLECT_GCC=egcc COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-unknown-openbsd7.6/11.2.0/lto-wrapper Target: x86_64-unknown-openbsd7.6 Configured with: /usr/obj/ports/gcc-11.2.0/gcc-11.2.0/configure --with-as=/usr/local/bin/gas --with-stage1-ldflags=-L/usr/obj/ports/gcc-11.2.0/bootstrap/lib --verbose --program-transform-name='s,^,e,' --disable-nls --with-system-zlib --disable-libmudflap --disable-libgomp --disable-libssp --disable-tls --with-gnu-ld --with-gnu-as --enable-threads=posix --enable-wchar_t --with-gmp=/usr/local --enable-languages=c,c++,fortran,objc,ada,d --disable-libstdcxx-pch --enable-default-pie --enable-standard-branch-protection --without-isl --enable-default-ssp --enable-cpp --prefix=/usr/local --sysconfdir=/etc --mandir=/usr/local/man --infodir=/usr/local/info --localstatedir=/var --disable-silent-rules --disable-gtk-doc Thread model: posix Supported LTO compression algorithms: zlib gcc version 11.2.0 (GCC)
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
The text was updated successfully, but these errors were encountered: