Bill Allombert wrote:
> On Fri, Dec 07, 2007 at 10:29:37PM +0000, Neil Williams wrote:
>> Bill Allombert wrote:
>>> On Wed, Nov 14, 2007 at 09:02:02AM +0000, Neil Williams wrote:
>>>> As part of the long term mass bug filing for cross building support,
>>>> (http://lists.debian.org/debian-devel/2007/11/msg00116.html), I've
>>>> prepared this patch for debian/rules.
>>>>
>>>> The patch also wraps 'make check' in a test for the 'nocheck'
>>>> DEB_BUILD_OPTION and prevents the replacement of the original 'libtool'
>>>> script when cross-compiling (the wrapper created by the package fails
>>>> to pass the correct tags to the cross compiler; using the original
>>>> script allows the cross build environment to handle the libtool call).
>>> Hello Neil,
>>>
>>> I do not understand how do that work given than the original libtool
>>> script is not able to build the package.
>> The patched source is capable of building natively and cross - tested
>> prior to filing the bug report.
> 
> This is nice, but I still do not understand how that work.

Because your replacement code is preserved if not cross compiling.

> The original
> libtool script has tons of issues (wrong runpath setting, missing
> platforms supports, etc.) . How do you avoid them ? Are you replacing it
> by some fixed libtool script automatically ?

We'll fix those when we come up against them. Have you reported that
upstream? Are the issues documented anywhere?

The fact is that your replacement libtool is just as broken, from a
cross build perspective. I prefer to debug a libtool that actually
builds a package rather than waste time on emulator issues and a libtool
that cannot cross build.

Emdebian will also be using the OpenEmbedded patches to see what else
may need changing. For now, I'm just concentrating on getting a package
that builds so that Emdebian can test those other changes. We may use
the WRAP_LIBTOOL variable to provide a more usable libtool, for example.

What matters to me is that the conditionals are added:
(email line wrapping notwithstanding)

+ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
+CROSS=CC=$(DEB_HOST_GNU_TYPE)-gcc
+confflags= --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
$(CROSS)
+WRAP_LIBTOOL=
+else
+confflags= --build $(DEB_BUILD_GNU_TYPE)
+WRAP_LIBTOOL=printf '#!/bin/sh\nexec libtool "$$@"\n' >libtool
+endif
+

and

+ifneq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
+CHECK=
+else
+CHECK=$(MAKE) test
+endif
+

with the code that supports those:

+        $(confflags)
+       $(WRAP_LIBTOOL)
+       $(MAKE) $(CROSS)
+       $(CHECK)
+       $(MAKE) -C debian/extra $(CROSS)

None of that affects how Debian builds the package and I don't see that
it would affect scratchbox either as the package has no cross build
support currently anyway.

>>>>
>>>> Please consider implementing this patch. Thanks.
>>> Did you check this patch actually allow libjpeg to be cross-compiled ?
>>> If yes, how did you proceed ?
>> http://www.emdebian.org/packages/search.php?arch=arm&distro=unstable&package=libjpeg62
>>
>> http://buildd.emdebian.org/svn/browser/current/target/trunk/l/libjpeg6b/trunk/libjpeg6b_6b-14em1_arm.build
> 
> That does not tell me how you proceed.

$ sudo apt-get install emdebian-tools
Choose "arm" as your default architecture for dpkg-cross
$ emsetup -v
installs the emdebian arm toolchain
$ emsource -v libjpeg6b
and cd to the build directory, then
$ emdebuild -v

or just use
$ emsource -v -b libjpeg6b

(all using -v|--verbose because it helps you see what is going on,
normally automated builds use --quiet).

The manpages, www.emdebian.org and the wiki pages should fill in the gaps.

> I would really like to try it
> for myself, else I am likely to break cross-building support in a 
> subsequent upload. 

You'll get a bug report from the Emdebian autobuild systems if that
happens. Don't worry.
:-)

> For example this package is supposed to be
> cross-buildable using scratchbox (according to the scratchbox people).
> If I apply your patch, will that still work ?

The patch only affects cross building. Scratchbox doesn't cross build,
it builds with emulation. A scratchbox build pretends that the build
machine is the host architecture and then scrabbles around in the
emulator trying to stop the program finding out the truth.

>> Emdebian will not be using emulators - it's all to be cross built from
>> Debian sources. I also disagree on the reliability of emulators but
>> that's by the by.
> 
> Well you can replace the emulator by real hardware in my setup.

The real hardware cannot run a compiler, that's why Emdebian cross
builds! We're targetting 32Mb iPAQ's and smaller. There's no point
thinking about replacing the emulator with the device for Emdebian - the
real device does not have the resources.

-- 


Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to