summaryrefslogtreecommitdiffstats
path: root/lib/libiconv_compat
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2013-08-13 07:15:01 +0000
committerpeter <peter@FreeBSD.org>2013-08-13 07:15:01 +0000
commit995e1f0063b0515ed5821ebab3aff02dbbe44719 (patch)
tree9bba3bf02dbd5d242b50c29cd7221d5ae286e560 /lib/libiconv_compat
parentd9e76bbffc59d724ea0ffe9896012f4ac0859bc7 (diff)
downloadFreeBSD-src-995e1f0063b0515ed5821ebab3aff02dbbe44719.zip
FreeBSD-src-995e1f0063b0515ed5821ebab3aff02dbbe44719.tar.gz
The iconv in libc did two things - implement the standard APIs, the GNU
extensions and also tried to be link time compatible with ports libiconv. This splits that functionality and enables the parts that shouldn't interfere with the port by default. WITH_ICONV (now on by default) - adds iconv.h, iconv_open(3) etc. WITH_LIBICONV_COMPAT (off by default) adds the libiconv_open etc API, linker symbols and even a stub libiconv.so.3 that are good enough to be able to 'pkg delete -f libiconv' on a running system and reasonably expect it to work. I have tortured many machines over the last few days to try and reduce the possibilities of foot-shooting as much as I can. I've successfully recompiled to enable and disable the libiconv_compat modes, ports that use libiconv alongside system iconv etc. If you don't enable the WITH_LIBICONV_COMPAT switch, they don't share symbol space. This is an extension of behavior on other system. iconv(3) is a standard libc interface and libiconv port expects to be able to run alongside it on systems that have it. Bumped osreldate.
Diffstat (limited to 'lib/libiconv_compat')
-rw-r--r--lib/libiconv_compat/Makefile7
-rw-r--r--lib/libiconv_compat/stub.c8
2 files changed, 15 insertions, 0 deletions
diff --git a/lib/libiconv_compat/Makefile b/lib/libiconv_compat/Makefile
new file mode 100644
index 0000000..3dcb3514
--- /dev/null
+++ b/lib/libiconv_compat/Makefile
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+LIB= iconv
+SHLIB_MAJOR= 3
+SRCS= stub.c
+
+.include <bsd.lib.mk>
diff --git a/lib/libiconv_compat/stub.c b/lib/libiconv_compat/stub.c
new file mode 100644
index 0000000..b4e56a2
--- /dev/null
+++ b/lib/libiconv_compat/stub.c
@@ -0,0 +1,8 @@
+/*
+ * Hacks to support things like the dlopen() in libkiconv.so or
+ * ports that want to hard-code -liconv.
+ *
+ * $FreeBSD$
+ */
+
+int __libiconv_stub__;
OpenPOWER on IntegriCloud