[Pkg-xen-devel] [PATCH 14/19] debian/rules: Set CC/LD to enable cross-building

Hans van Kranenburg hans at knorrie.org
Tue Dec 15 20:55:14 GMT 2020


Hi!

On 12/15/20 6:03 PM, Elliott Mitchell wrote:
> On Tue, Dec 15, 2020 at 02:55:35PM +0100, Hans van Kranenburg wrote:
>> Hi,
>>
>> On 7/17/20 4:07 AM, Elliott Mitchell wrote:
>>> Always set $(CC) and $(LD) when building.  This has no effect on native
>>> builds, but is needed for cross-builds to use the right compiler.
>>>
>>> Signed-off-by: Elliott Mitchell <ehem+debian at m5p.com>
>>> ---
>>>  debian/rules | 2 ++
>>>  1 file changed, 2 insertions(+)
>>>
>>> diff --git a/debian/rules b/debian/rules
>>> index 95f3cc4311..dffdef9a9d 100755
>>> --- a/debian/rules
>>> +++ b/debian/rules
>>> @@ -135,6 +135,8 @@ dpkg_CPPFLAGS := $(shell $(dbmo) dpkg-buildflags --get CPPFLAGS)
>>>  dpkg_LDFLAGS  := $(shell $(dbmo) dpkg-buildflags --get LDFLAGS)
>>>  
>>>  make_args_common := \
>>> +	CC=$(DEB_HOST_MULTIARCH)-gcc \
>>> +	LD=$(DEB_HOST_MULTIARCH)-ld \
>>>  	XEN_COMPILE_ARCH=$(xen_arch_$(DEB_BUILD_ARCH))
>>>  
>>>  make_args_xen := $(make_args_common) \
>>>
>>
>> Hm, this causes an FTBFS on i386 :(
>>
>> https://buildd.debian.org/status/fetch.php?pkg=xen&arch=i386&ver=4.14.0%2B88-g1d1d1f5391-1&stamp=1608036439&raw=0
>>
>> scripts/Kconfig.include:39: compiler 'i386-linux-gnu-gcc' not found
>>
>> Oh, yay, on i386, the thing is named /usr/bin/i686-linux-gnu-gcc, sigh.
>>
>> Since it's most important *right now* to get the security patches out, I
>> will re-upload with this change reverted. Afterwards we can see what the
>> best solution will be.
> 
> `dpkg-architecture` has *waay* too many variables and figuring out which
> of the several very subtly different ones you need is a challenge.
> Appears $(DEB_HOST_GNU_TYPE) is needed instead of $(DEB_HOST_MULTIARCH).
> 
> Sorry about that one.

I also hadn't tried building all the archs myself before uploading to
Debian.

Actually, Maximilian has been working on enabling gitlab ci on salsa for
all of it, which is rather exciting, because I guess we can spot more
FTBFS earlier on. Well, as soon as we can also build other archs in
there... I think it's amd64 and i386 now.

I just tried with DEB_HOST_GNU_TYPE and that indeed DTRT. Thanks for
your comments. I'll add the commit back with that change.

> Other concern is what if CLANG builds take off?  I would *strongly*
> prefer to use $(DEB_HOST_GNU_TYPE)-cc, but neither GCC nor CLANG install
> that particular symbolic link.  That is the correct name for "I want a
> compiler for <arch>" when you don't actually care what flavor of compiler
> is being used.
One step at a time. :)

Hans

P.S. looking forward to be able to include the rest of the stuff that
you had queued...



More information about the Pkg-xen-devel mailing list