Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 185681 - media-libs/freetype-2.3.4-r2 crosscompile fails to detect the correct CC_BUILD
Summary: media-libs/freetype-2.3.4-r2 crosscompile fails to detect the correct CC_BUILD
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Gentoo Fonts Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-17 17:53 UTC by Eddy Petrișor
Modified: 2007-08-11 00:36 UTC (History)
1 user (show)

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


Attachments
freetype-2.3.5-crossbuild.patch (freetype-2.3.5-crossbuild.patch,1.98 KB, patch)
2007-07-18 04:57 UTC, Ryan Hill (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eddy Petrișor 2007-07-17 17:53:57 UTC
I tried to crossbuild media-libs/freetype-2.3.4-r2 for arm-softfloat-linux-uclibc using the xmerge script provided in the Cross development guide (http://www.gentoo.org/proj/en/base/embedded/cross-development.xml)

The host is a i486-pc-linux-gnu clean chroot (stage3 unpacked, emerge sync-ed, portage updated, installed crossdev for arm-softfloat-linux-uclibc).


<eddyp> I found a bug when trying to cross compile freetype
<eddyp> the configure script detects the i486-pc-linux-gnu-gcc as i486-pc-liunx-gnu
<eddyp> no trailing -gcc and, of course, if fails to crossbuild
<eddyp> I tried to configure by hand in the source directory the CC_BUILD variable and it(the configuration stage) works if overridden
<eddyp> I don't know where to report this since I don't know if is an ebuild/package/toolchain issue
<eddyp> this is what happens ... http://paste.debian.net/32916
<eddyp> I am trying to cross compile rrdtool for arm-softfloat-linux-uclibc


Here is a listing that proves that CC_BUILD is valid workaround (I haven't checked the results, 'though)

(chroot) twix freetype-2.3.4 # ./configure --prefix=/usr --host=arm-softfloat-linux-uclibc --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --with-zlib --build=i486-pc-linux-gnu

FreeType build system -- automatic system detection

The following settings are used:

  platform                    unix
  compiler                    cc
  configuration directory     ./builds/unix
  configuration rules         ./builds/unix/unix.mk

If this does not correspond to your system or settings please remove the file
`config.mk' from this directory then read the INSTALL file for help.

Otherwise, simply type `make' again to build the library,
or `make refdoc' to build the API reference (the latter needs python).

configuring with CC_BUILD unset:

cd builds/unix; ./configure  "--prefix=/usr" "--host=arm-softfloat-linux-uclibc" "--mandir=/usr/share/man" "--infodir=/usr/share/info" "--datadir=/usr/share" "--sysconfdir=/etc" "--localstatedir=/var/lib" "--with-zlib" "--build=i486-pc-linux-gnu"
checking build system type... i486-pc-linux-gnu
checking host system type... arm-softfloat-linux-uclibc
checking target system type... arm-softfloat-linux-uclibc
checking for arm-softfloat-linux-uclibc-gcc... arm-softfloat-linux-uclibc-gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether arm-softfloat-linux-uclibc-gcc accepts -g... yes
checking for arm-softfloat-linux-uclibc-gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... arm-softfloat-linux-uclibc-gcc -E
checking for i486-pc-linux-gnu-gcc... i486-pc-linux-gnu
checking for i486-pc-linux-gnu-gcc... (cached) i486-pc-linux-gnu
checking for i486-pc-linux-gnu-gcc... (cached) i486-pc-linux-gnu
checking for suffix of native executables... ./configure: line 3392: i486-pc-linux-gnu: command not found
configure: error: native C compiler is not working
make: *** [setup] Error 1


configuring with CC_BUILD set to the host compiler

(chroot) twix freetype-2.3.4 # export CC_BUILD=i486-pc-linux-gnu-gcc
(chroot) twix freetype-2.3.4 # ./configure --prefix=/usr --host=arm-softfloat-linux-uclibc --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --with-zlib --build=i486-pc-linux-gnu

FreeType build system -- automatic system detection

The following settings are used:

  platform                    unix
  compiler                    cc
  configuration directory     ./builds/unix
  configuration rules         ./builds/unix/unix.mk

If this does not correspond to your system or settings please remove the file
`config.mk' from this directory then read the INSTALL file for help.

Otherwise, simply type `make' again to build the library,
or `make refdoc' to build the API reference (the latter needs python).

cd builds/unix; ./configure  "--prefix=/usr" "--host=arm-softfloat-linux-uclibc" "--mandir=/usr/share/man" "--infodir=/usr/share/info" "--datadir=/usr/share" "--sysconfdir=/etc" "--localstatedir=/var/lib" "--with-zlib" "--build=i486-pc-linux-gnu"
checking build system type... i486-pc-linux-gnu
checking host system type... arm-softfloat-linux-uclibc
checking target system type... arm-softfloat-linux-uclibc
checking for arm-softfloat-linux-uclibc-gcc... arm-softfloat-linux-uclibc-gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether arm-softfloat-linux-uclibc-gcc accepts -g... yes
checking for arm-softfloat-linux-uclibc-gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... arm-softfloat-linux-uclibc-gcc -E
checking for i486-pc-linux-gnu-gcc... i486-pc-linux-gnu-gcc
checking for i486-pc-linux-gnu-gcc... (cached) i486-pc-linux-gnu-gcc
checking for i486-pc-linux-gnu-gcc... (cached) i486-pc-linux-gnu-gcc
checking for suffix of native executables...
checking for rm... rm -f
....
Comment 1 Eddy Petrișor 2007-07-17 18:08:32 UTC
Forgot to say, the package builds fine when exporting CC_BUILD
Comment 2 Ryan Hill (RETIRED) gentoo-dev 2007-07-18 04:50:34 UTC
hmm, i don't have much time to look into this at the moment, but does something like this help?

diff -Naur freetype-2.3.5-orig/builds/unix/configure.ac freetype-2.3.5/builds/unix/configure.ac
--- freetype-2.3.5-orig/builds/unix/configure.ac        2007-07-02 15:41:39.000000000 -0600
+++ freetype-2.3.5/builds/unix/configure.ac     2007-07-17 22:48:08.000000000 -0600
@@ -40,7 +40,7 @@
 # checks for native programs to generate building tool

 if test ${cross_compiling} = yes; then
-  AC_CHECK_PROG(CC_BUILD, ${build}-gcc, ${build-gcc})
+  AC_CHECK_PROG(CC_BUILD, ${build}-gcc, ${build}-gcc)
   test -z "${CC_BUILD}" && AC_CHECK_PROG(CC_BUILD, gcc, gcc)
   test -z "${CC_BUILD}" && AC_CHECK_PROG(CC_BUILD, cc, cc, , , /usr/ucb/cc)
   test -z "${CC_BUILD}" && AC_MSG_ERROR([cannot find native C compiler])
Comment 3 Ryan Hill (RETIRED) gentoo-dev 2007-07-18 04:57:12 UTC
Created attachment 125227 [details, diff]
freetype-2.3.5-crossbuild.patch

here's the full patch.
Comment 4 Eddy Petrișor 2007-08-10 15:41:24 UTC
with this patch it compiles correctly.

https://bugs.gentoo.org/attachment.cgi?id=125227
Comment 5 Ryan Hill (RETIRED) gentoo-dev 2007-08-11 00:36:55 UTC
Applied to freetype-2.3.4-r2 and freetype-2.3.5.  I've sent this patch upstream as well.  Thanks for reporting.