Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 266591 - mail-mta/exim-4.69: Fix cross-compilation
Summary: mail-mta/exim-4.69: Fix cross-compilation
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Fabian Groffen
URL:
Whiteboard: patchupstream ebuildpatch
Keywords:
Depends on: 266588
Blocks: 237593
  Show dependency tree
 
Reported: 2009-04-17 22:38 UTC by Bertrand Jacquin
Modified: 2011-08-03 19:10 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build buildconfig using HOSTCC (exim-BJA-buildconfig-HOSTCC.diff,490 bytes, patch)
2009-04-17 22:39 UTC, Bertrand Jacquin
Details | Diff
mail-mta/exim-4.69.ebuild diff (exim-4.69.diff,766 bytes, patch)
2009-04-17 22:40 UTC, Bertrand Jacquin
Details | Diff
mail-mta/exim-4.69.ebuild.diff (exim-4.69.diff,1.95 KB, patch)
2009-04-18 15:44 UTC, Bertrand Jacquin
Details | Diff
exim-4.76.ebuild (exim-4.76.ebuild-BJA-HOSTCC.diff,689 bytes, patch)
2011-07-28 19:17 UTC, Bertrand Jacquin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bertrand Jacquin 2009-04-17 22:38:15 UTC
exim don't cross-compile correctly as it start by building a tool (buildconfig) which build the configure. As it is used runtime on compilation, it should be build with HOSTCC instead of TARGETCC :

make[1]: Entering directory `/usr/i586-geode-linux-uclibc/tmp/portage/mail-mta/exim-4.69/work/exim-4.69/build-exim-gentoo'
/bin/sh ../scripts/Configure-os.h
/bin/sh ../scripts/Configure-os.c
i586-geode-linux-uclibc-gcc buildconfig.c
/bin/sh ../scripts/Configure-config.h "make"
make[2]: Entering directory `/usr/i586-geode-linux-uclibc/tmp/portage/mail-mta/exim-4.69/work/exim-4.69/build-exim-gentoo'
make[2]: `buildconfig' is up to date.
make[2]: Leaving directory `/usr/i586-geode-linux-uclibc/tmp/portage/mail-mta/exim-4.69/work/exim-4.69/build-exim-gentoo'
/bin/sh: line 77: ./buildconfig: No such file or directory
make[1]: *** [config.h] Error 1
make[1]: Leaving directory `/usr/i586-geode-linux-uclibc/tmp/portage/mail-mta/exim-4.69/work/exim-4.69/build-exim-gentoo'
make: *** [go] Error 2

exim-BJA-buildconfig-HOSTCC.diff fix that issue really simply.

then, exim should depend on virtual/libiconv which is not available on uclibc, so just a thin patch to the dependencie. You still need to export LDFAGS="-liconv" manually (I don't think that should be included in ebuild).

>>> exim_checkaccess script built

i586-geode-linux-uclibc-gcc exim_dbmbuild.c
In file included from exim_dbmbuild.c:33:
exim.h:460:19: iconv.h: No such file or directory
make[1]: *** [exim_dbmbuild.o] Error 1
make[1]: Leaving directory `/usr/i586-geode-linux-uclibc/tmp/portage/mail-mta/exim-4.69/work/exim-4.69/build-exim-gentoo'
make: *** [go] Error 2


Reproducible: Always

Steps to Reproduce:
1. crossdev -t i586-geode-linux-uclibc
2. emerge-wrapper --init
3. i586-geode-linux-uclibc -vat exim
Comment 1 Bertrand Jacquin 2009-04-17 22:39:43 UTC
Created attachment 188741 [details, diff]
build buildconfig using HOSTCC
Comment 2 Bertrand Jacquin 2009-04-17 22:40:56 UTC
Created attachment 188743 [details, diff]
mail-mta/exim-4.69.ebuild diff
Comment 3 Bertrand Jacquin 2009-04-17 23:21:54 UTC
patch exim-BJA-buildconfig-HOSTCC.diff have been reported upstream :
http://thread.gmane.org/gmane.mail.exim.devel/3382
Comment 4 Bertrand Jacquin 2009-04-18 15:44:36 UTC
Created attachment 188803 [details, diff]
mail-mta/exim-4.69.ebuild.diff

This also fix building with ldap,sql,ssl support by using propre ROOT and libdir
Comment 5 Torsten Veller (RETIRED) gentoo-dev 2009-06-24 13:33:18 UTC
Reassign to net-mail herd as peitolm retires
Comment 6 Fabian Groffen gentoo-dev 2009-07-24 07:20:22 UTC
ROOT and libdir now handled in exim-4.69-r2, other fixes not yet applied
Comment 7 Fabian Groffen gentoo-dev 2009-07-24 07:47:07 UTC
libiconv issue handled in the ebuild now
Comment 8 Fabian Groffen gentoo-dev 2009-07-24 07:56:08 UTC
(In reply to comment #3)
> patch exim-BJA-buildconfig-HOSTCC.diff have been reported upstream :
> http://thread.gmane.org/gmane.mail.exim.devel/3382

This patch does not work for me in a non-cross compile setting.  Can you explain where HOSTCC is supposed to be coming from?  Also, could you please look at the latest version of exim-4.69-r2 to see what you still need?
Comment 9 Bertrand Jacquin 2009-08-02 20:36:54 UTC
(In reply to comment #8)
> (In reply to comment #3)
> > patch exim-BJA-buildconfig-HOSTCC.diff have been reported upstream :
> > http://thread.gmane.org/gmane.mail.exim.devel/3382
> 
> This patch does not work for me in a non-cross compile setting.  Can you
> explain where HOSTCC is supposed to be coming from?  Also, could you please
> look at the latest version of exim-4.69-r2 to see what you still need?

Ah yes, I always define HOSTCC. This should be the host compiler as 'buildconfig' binary is used runtime during compilation, so it need to be build for the host, not the target. HOSTCC can be define in src_compile anyway, via HOSTCC="$CHOST-gcc" for example.

Comment 10 Fabian Groffen gentoo-dev 2009-08-03 07:48:39 UTC
That's a bit hacky and non-generic, e.g. that won't make the patch acceptable upstream.  We probably need a solution where HOSTCC defaults to CC if it isn't set.
Comment 11 Bertrand Jacquin 2009-08-03 22:36:06 UTC
HOSTCC & CC are generic in autofoo lands, it would just be import from another land. but this is pretty standart I think

Makefile could be like :

CC ?= gcc
HOSTCC ?= $(CC)

Don't you think ?
Comment 12 Fabian Groffen gentoo-dev 2009-08-04 07:22:10 UTC
that would be ok, and then from the ebuild CC is set to the right value because we do emake CC=$(tc-getCC) ... but that still doesn't set HOSTCC to the right compiler if you cross.  Does crossdev wrapper facilitate in setting HOSTCC?
Comment 13 Bertrand Jacquin 2009-08-06 18:31:18 UTC
(In reply to comment #12)
> that would be ok, and then from the ebuild CC is set to the right value because
> we do emake CC=$(tc-getCC) ... but that still doesn't set HOSTCC to the right
> compiler if you cross.  Does crossdev wrapper facilitate in setting HOSTCC?

Yes, It define HOSTCC in make.conf :

/usr/share/crossdev/etc/make.conf:
HOSTCC=__CBUILD__-gcc

Replaced after.

Also, people cross-compilating generally known that it need to be defined.

Comment 14 Bertrand Jacquin 2011-07-28 19:17:41 UTC
Created attachment 281325 [details, diff]
exim-4.76.ebuild

This patch is a refresh for exim-4.76
Comment 15 Fabian Groffen gentoo-dev 2011-08-03 19:10:28 UTC
Committed in 4.67-r1, thanks for your patience.