Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 480878 - media-lib/libpng-1.6.3-r1:0 - fix support for cross-compiling
Summary: media-lib/libpng-1.6.3-r1:0 - fix support for cross-compiling
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2013-08-13 14:16 UTC by Rafal Lalik
Modified: 2014-11-15 07:53 UTC (History)
2 users (show)

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


Attachments
Fixes the ebuild to pass proper INCLUDES to the Makefile (libpng-1.6.3-r1_crosscompile.patch,508 bytes, patch)
2013-08-13 14:16 UTC, Rafal Lalik
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rafal Lalik 2013-08-13 14:16:20 UTC
Created attachment 355878 [details, diff]
Fixes the ebuild to pass proper INCLUDES to the Makefile

While cross-compiling libpng its configure script searches for zlib.h inside gcc default "/usr/${CHOST}/usr/include" path. If CBUILD == CHOST ?= CTARGET it works fine but for CBUILD != CHOST ?= CTARGET it fails as usually SYSROOT for CHOST is different than
/usr/${CHOST}. It will actually always fails when SYSROOT != /usr/${CHOST} even if SYSROOT is exported and --sysroot=${SYSROOT} is passed as a gcc argument.

libpng's Makefile can accept additional variable INCLUDES attached later to the all gcc calls and thus proper include path can be passed there. In my patch I propose to modify the src_compile() call to export INCLUDES variable when cross-compiling is detected.

Tested with arm cross-compiling. Before this changes it did not work:
 - cross compiling configuration: CBUILD=x86_64 CHOST=arm CTARGET=arm
 - configure found incorrect zlib.h in /usr/${CHOST}/usr/include instead of ${SYSROOT}/usr/include
 - after removing zlib from /usr/${CHOST}/usr/include, proper ${SYSROOT}/usr/include/zlib.h was not found

Rafal
Comment 1 Samuli Suominen (RETIRED) gentoo-dev 2014-04-06 10:43:33 UTC
vapier, any chance you could take a look at this?  i really don't like the approach of carrying such a hack in the ebuild forever :/
Comment 2 SpanKY gentoo-dev 2014-11-15 07:53:04 UTC
i'm reading the libpng configure script and not seeing a problem.  i also don't understand the issue as described -- if you've changed SYSROOT, then your gcc needs the right flags to set --sysroot so it'll search the right place.  hacking various packages to bypass that is not the way to go.