build / update exim show error

nservices

Verified User
Joined
Dec 11, 2008
Messages
302
cd /usr/local/directadmin/custombuild/
./build exim

result:
Code:
cc -o exim
rfc2047.o: In function `rfc2047_decode2':
rfc2047.c:(.text+0x3e9): undefined reference to `libiconv_open'
rfc2047.c:(.text+0x4d7): undefined reference to `libiconv'
rfc2047.c:(.text+0x565): undefined reference to `libiconv_close'
collect2: error: ld returned 1 exit status
make[1]: Leaving directory '/usr/local/directadmin/custombuild/tmp/tmp.nCrl4qD0Bq.exim-4.96.2-12-g29d01ae2a.tar.gz/build-Linux-x86_64'
make[1]: *** [Makefile:635: exim] Error 1
make: *** [Makefile:36: all] Error 2
doExim: failed to compile '/usr/local/directadmin/custombuild/cache/exim-4.96.2-12-g29d01ae2a.tar.gz' inside '/usr/local/directadmin/custombuild/tmp/tmp.nCrl4qD0Bq.exim-4.96.2-12-g29d01ae2a.tar.gz'
failed to compile exim 4.96.2-12-g29d01ae2a

Please advice,
 
found in other topic, maybe it helps

just edit Local/Makefile, add these lines:
Code:
HAVE_ICONV=yes  
CFLAGS=-O -I/usr/local/include  
EXTRALIBS_EXIM=-L/usr/local/lib -liconv
And run:
Code:
make
make install
 
Exim compilation problem can be caused by a custom libiconv library installed in /usr/local. A quick check if you have custom libiconv is to see if file /usr/local/include/iconv.h exists.

Removing the custom libiconv library would solve the issue. Following commands would completely remove it from the system:

Code:
rm -f /usr/local/include/{libcharset.h,localcharset.h,iconv.h}
rm -f /usr/local/lib/{libcharset,libiconv}*
rm -f /usr/local/bin/iconv
rm -f /usr/local/share/man/man*/iconv*
rm -f /usr/local/share/doc/iconv*
rm -f /usr/local/share/locale/*/LC_MESSAGES/libiconv.mo

Special care should be taken to not add extra spaces between * symbols to not remove other files.

Minimal change to make sure exim compiles is just to remove the conflicting header files:

Code:
rm -f /usr/local/include/{libcharset.h,localcharset.h,iconv.h}
 
If you need to customize the Makefile, type:
Code:
cd /usr/local/directadmin/custombuild
mkdir -p custom/exim/
wget -O custom/exim/Makefile http://files.directadmin.com/services/custombuild/Makefile
 
If you need to customize the Makefile, type:
The Makefile in our mirror server is obsolete, if you want to customize it take the latest one that comes with DA:

Code:
cd /usr/local/directadmin/custombuild
mkdir -p custom/exim/
cp configure/exim/Makefile custom/exim/Makefile
 
Thanks @Active8! Exim docs are updated now. I see there could be more obsolete links to our files server, will make sure to check all of them.
 
Exim compilation problem can be caused by a custom libiconv library installed in /usr/local. A quick check if you have custom libiconv is to see if file /usr/local/include/iconv.h exists.
I have this on Centos7 box which contains this, should i remove it an build exim again ? or can we leave as is ?

EDIT: Almalinux 8 have this too i see
 
Last edited:
I would recommend removing the custom iconv library and using the default library that comes with the system. Do you know the reason why custom iconv library was installed?
 
Do you know the reason why custom iconv library was installed?
No I dont but even an fresh installed DA box with Almalinux 8 has it
Both are installed with default values, no any special software beside DA programs is installed

Strange things is ./build exim works fine without problems
Exim build has errors fixed by your solution but now run in other problems

libiconv.so.2: cannot open shared
 
Last edited:
After using this command, i am now having issues with installing php version (8.1 in this case)

Code:
rm -f /usr/local/include/{libcharset.h,localcharset.h,iconv.h}

Getting the error:

Code:
checking for iconv support... yes
configure: error: Please reinstall the iconv library.

How can I re-install iconv again so it doesnt break php updates?
 
How can I re-install iconv again so it doesnt break php updates?
You have walked in the same problem as me, i want to share my dirty workaround

0. Move back your backup
1. Move temporary file iconv.h to an other place
2. build your exim (that should work)
3. after rebuild put the file back to the original place to avoid build problems with let say php

@DirectAdmin Support @fln people really getting into trouble by your decision to alter Makefile file with latest DA update
People who had build in the past with custombuild (and not manual as was suggested before) have now problems
 
Last edited:
You have walked in the same problem as me, i want to share my dirty workaround

0. Move back your backup
1. Move temporary file iconv.h to an other place
2. build your exim (that should work)
3. after rebuild put the file back to the original place to avoid build problems with let say php

@DirectAdmin Support @fln people really getting into trouble by your decision to alter Makefile file with latest DA update
People who had build in the past with custombuild (and not manual as was suggested before) have now problems
Yes, we're having the same issues. We spent a lot of time troubleshooting and manually removing old libraries (iconv, pcre, libxml) etc. which were built by Custombuild in the past in order to be able to upgrade both Exim and PHP. We would prefer a removal/cleanup script to be made available by DA support, such as the one to remove and clean up old Curl files built by Custombuild.
 
I'm not having this problem. but I just come to suggestion.

After you build/remove library, I recommended to manual execute
Code:
ldconfig

Make sure new library is loading in correct path.
Code:
ldconfig -p | grep iconv

it must show library path in "/use/lib(64)/"

this is common knowledge between OS installer and manual installer package. But some OS Package might in "/use/local/"

If non any showing, so your server not have any installer package.
 
You have walked in the same problem as me, i want to share my dirty workaround

0. Move back your backup
1. Move temporary file iconv.h to an other place
2. build your exim (that should work)
3. after rebuild put the file back to the original place to avoid build problems with let say php

@DirectAdmin Support @fln people really getting into trouble by your decision to alter Makefile file with latest DA update
People who had build in the past with custombuild (and not manual as was suggested before) have now problems

I didnt backup the file.... :whistle:
Would appreciate if someone could tell how to fix this issue, once you have deleted the file as me :)
 
Would appreciate if someone could tell how to fix this issue, once you have deleted the file as me :)
You can install custom iconv library back with:

Code:
cd /root
wget https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.17.tar.gz
tar xf libiconv-1.17.tar.gz
cd libiconv-1.17
./configure
make
make install
cd /root
rm -rf libiconv-1.17.tar.gz libiconv-1.17

However I would not recommend installing libiconv back. It would be better to remove it completely and rebuild the software that was linked agains the custom library. For example rebuild PHP. All PHP versions on all systems can be built just fine without having custom libiconv installed in /usr/local. PHP recompile might fail if:
  • Configure script was customized to expect a custom libiconv to be present.
  • libiconv was not removed completely and PHP detects it but fails to use it.
You can always open a support ticket and we will help you out.

We would prefer a removal/cleanup script to be made available by DA support, such as the one to remove and clean up old Curl files built by Custombuild.
Yes, we are considering this approach. I was not aware CB used to build custom iconv. However this is not easy to do reliably (because we need to investigate the exetent of old iconv integration to know which packages needs to be rebuild), so it might take some time.
 
To be clear: this is a much broader problem. We have confirmed that all the following libraries used to be supplied by Custombuild and are no longer: iconv, libxml2/lib(e)xslt, libpcre2, libspf2, libsodium, libzip, libzstd, libtool, libpng/libjpg/libwebp, libcharset, libfreetype2. The cheatsheet on https://forum.directadmin.com/threads/custombuild-cheat-sheet.58211/ also list a huge amount of the libraries that DA used to make available through CB. I've spent well over a full work day already on trying to clean up this mess on individual servers because the files are spread out a lot and there's always something that's looking for libraries in the wrong place. This is really a huge issue! A cleanup script is paramount. I think it's absolutely the right approach.
 
You can install custom iconv library back with:
No we want first removed it , how can we remove it in the first place ?
Whe we do this:
Code:
rm -f /usr/local/include/{libcharset.h,localcharset.h,iconv.h}
rm -f /usr/local/lib/{libcharset,libiconv}*
rm -f /usr/local/bin/iconv
rm -f /usr/local/share/man/man*/iconv*
rm -f /usr/local/share/doc/iconv*
rm -f /usr/local/share/locale/*/LC_MESSAGES/libiconv.mo
The rebuild like php get in trouble with PHP

Code:
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

libiconv.so.2: cannot open shared object file: No such file or directory

Please install a package which provides this module, or
verify that the module is installed correctly.

It's possible that the above module doesn't match the
current version of Python, which is:
2.7.5 (default, Jun 20 2023, 11:36:40)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]

Which let us run in circles
 
Back
Top