Remove the WITH_LIBICONV_COMPAT hack that seems to do more harm than

good.  This caused libc to spoof the ports libiconv namespace and
provide a colliding libiconv.so.3 to fool rtld.  This should have
been removed some time ago.
This commit is contained in:
Peter Wemm 2013-11-03 19:04:57 +00:00
parent cb491a4d63
commit 912ce912e1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=257583
10 changed files with 7 additions and 82 deletions

View File

@ -38,6 +38,12 @@
# xargs -n1 | sort | uniq -d; # xargs -n1 | sort | uniq -d;
# done # done
# 20131103: WITH_LIBICONV_COMPAT removal
OLD_FILES+=usr/include/_libiconv_compat.h
OLD_FILES+=usr/lib/libiconv.a
OLD_FILES+=usr/lib/libiconv.so
OLD_FILES+=usr/lib/libiconv.so.3
OLD_FILES+=usr/lib/libiconv_p.a
# 20131103: removal of utxrm(8), use 'utx rm' instead. # 20131103: removal of utxrm(8), use 'utx rm' instead.
OLD_FILES+=usr/sbin/utxrm OLD_FILES+=usr/sbin/utxrm
OLD_FILES+=usr/share/man/man8/utxrm.8.gz OLD_FILES+=usr/share/man/man8/utxrm.8.gz

View File

@ -83,15 +83,7 @@ _netipx= netipx
# Handle the #define aliases for libiconv # Handle the #define aliases for libiconv
.if ${MK_ICONV} == "yes" .if ${MK_ICONV} == "yes"
CLEANFILES+= _libiconv_compat.h INCS+= iconv.h
INCS+= _libiconv_compat.h iconv.h
_libiconv_compat.h: ${.CURDIR}/Makefile
echo "/* Indicate whether libiconv symbols are present */" > _libiconv_compat.h
.if ${MK_LIBICONV_COMPAT} == "yes"
echo "#define __LIBICONV_COMPAT" >> _libiconv_compat.h
.else
echo "#undef __LIBICONV_COMPAT" >> _libiconv_compat.h
.endif
.endif .endif

View File

@ -40,13 +40,6 @@
#include <sys/cdefs.h> #include <sys/cdefs.h>
#include <sys/types.h> #include <sys/types.h>
#include <_libiconv_compat.h>
#ifdef __LIBICONV_COMPAT
#define libiconv_open iconv_open
#define libiconv_close iconv_close
#define libiconv iconv
#define libiconv_t iconv_t
#endif
#ifdef __cplusplus #ifdef __cplusplus
typedef bool __iconv_bool; typedef bool __iconv_bool;
#elif __STDC_VERSION__ >= 199901L #elif __STDC_VERSION__ >= 199901L
@ -76,22 +69,10 @@ size_t __iconv(iconv_t, const char **, size_t *, char **,
/* /*
* GNU interfaces for iconv * GNU interfaces for iconv
*/ */
#ifdef __LIBICONV_COMPAT
#define libiconv_open_into iconv_open_into
#define libiconvctl iconvctl
#define libiconvlist iconvlist
#define libiconv_set_relocation_prefix iconv_set_relocation_prefix
#endif
/* We have iconvctl() */ /* We have iconvctl() */
#define _ICONV_VERSION 0x0108 #define _ICONV_VERSION 0x0108
extern int _iconv_version; extern int _iconv_version;
#ifdef __LIBICONV_COMPAT
#define _libiconv_version _iconv_version
#define _LIBICONV_VERSION _ICONV_VERSION
#endif
typedef struct { typedef struct {
void *spaceholder[64]; void *spaceholder[64];
} iconv_allocation_t; } iconv_allocation_t;

View File

@ -81,7 +81,6 @@ SUBDIR= ${SUBDIR_ORDERED} \
${_libgpib} \ ${_libgpib} \
${_libgssapi} \ ${_libgssapi} \
${_librpcsec_gss} \ ${_librpcsec_gss} \
${_libiconv_compat} \
libipsec \ libipsec \
${_libipx} \ ${_libipx} \
libjail \ libjail \
@ -188,10 +187,6 @@ _libcxxrt= libcxxrt
_libcplusplus= libc++ _libcplusplus= libc++
.endif .endif
.if ${MK_LIBICONV_COMPAT} != "no"
_libiconv_compat= libiconv_compat
.endif
.if ${MK_LIBTHR} != "no" .if ${MK_LIBTHR} != "no"
_libthr= libthr _libthr= libthr
.endif .endif

View File

@ -6,15 +6,7 @@ FBSD_1.2 {
__iconv; __iconv;
__iconv_free_list; __iconv_free_list;
__iconv_get_list; __iconv_get_list;
_libiconv_version;
iconv_canonicalize; iconv_canonicalize;
libiconv;
libiconv_close;
libiconv_open;
libiconv_open_into;
libiconv_set_relocation_prefix;
libiconvctl;
libiconvlist;
}; };
FBSD_1.3 { FBSD_1.3 {

View File

@ -47,18 +47,6 @@
#include "citrus_hash.h" #include "citrus_hash.h"
#include "citrus_iconv.h" #include "citrus_iconv.h"
#include <_libiconv_compat.h>
#ifdef __LIBICONV_COMPAT
__weak_reference(iconv, libiconv);
__weak_reference(iconv_open, libiconv_open);
__weak_reference(iconv_open_into, libiconv_open_into);
__weak_reference(iconv_close, libiconv_close);
__weak_reference(iconvlist, libiconvlist);
__weak_reference(iconvctl, libiconvctl);
__weak_reference(iconv_set_relocation_prefix, libiconv_set_relocation_prefix);
__weak_reference(_iconv_version, _libiconv_version);
#endif
#define ISBADF(_h_) (!(_h_) || (_h_) == (iconv_t)-1) #define ISBADF(_h_) (!(_h_) || (_h_) == (iconv_t)-1)
int _iconv_version = _ICONV_VERSION; int _iconv_version = _ICONV_VERSION;

View File

@ -1,9 +0,0 @@
# $FreeBSD$
LIB= iconv
SHLIB_MAJOR= 3
SRCS= stub.c
WARNS?= 0
.include <bsd.lib.mk>

View File

@ -1,8 +0,0 @@
/*
* Hacks to support things like the dlopen() in libkiconv.so or
* ports that want to hard-code -liconv.
*
* $FreeBSD$
*/
int __libiconv_stub__;

View File

@ -368,7 +368,6 @@ __DEFAULT_NO_OPTIONS = \
DEBUG_FILES \ DEBUG_FILES \
GPL_DTC \ GPL_DTC \
HESIOD \ HESIOD \
LIBICONV_COMPAT \
INSTALL_AS_USER \ INSTALL_AS_USER \
LLDB \ LLDB \
NAND \ NAND \
@ -492,10 +491,6 @@ MK_${var}:= no
MK_LIBTHR:= no MK_LIBTHR:= no
.endif .endif
.if ${MK_ICONV} == "no"
MK_LIBICONV_COMPAT:= no
.endif
.if ${MK_LDNS} == "no" .if ${MK_LDNS} == "no"
MK_LDNS_UTILS:= no MK_LDNS_UTILS:= no
MK_UNBOUND:= no MK_UNBOUND:= no

View File

@ -3136,13 +3136,6 @@ OLD_FILES+=usr/share/man/man1/host.1.gz
# to be filled in # to be filled in
#.endif #.endif
.if ${MK_LIBICONV_COMPAT} == no
OLD_FILES+=usr/lib/libiconv.a
OLD_FILES+=usr/lib/libiconv.so
OLD_FILES+=usr/lib/libiconv.so.3
OLD_FILES+=usr/lib/libiconv_p.a
.endif
.if ${MK_LIBCPLUSPLUS} == no .if ${MK_LIBCPLUSPLUS} == no
OLD_LIBS+=lib/libcxxrt.so.1 OLD_LIBS+=lib/libcxxrt.so.1
OLD_FILES+=usr/lib/libc++.a OLD_FILES+=usr/lib/libc++.a