#651780 Cannot build slamr.ko on 64-bit host

#651780#5
Date:
2011-12-12 05:42:11 UTC
From:
To:
The makefile disables building slamr.ko if the build host's kernel is
64-bit.  It should instead be testing whether the target kernel is
32-bit:

ifdef CONFIG_X86_32
...
endif

#651780#10
Date:
2011-12-12 08:59:36 UTC
From:
To:
---end quoted text---

  Why would that be needed ? Shouldn't a 32-bit module be built on a
  machine with 32-bit kernel ?

#651780#15
Date:
2011-12-12 08:59:36 UTC
From:
To:
---end quoted text---

  Why would that be needed ? Shouldn't a 32-bit module be built on a
  machine with 32-bit kernel ?

#651780#20
Date:
2011-12-12 15:16:36 UTC
From:
To:
No, modules should not have to be built on the same system that will use
them.  (I can accept that they have to be built on the same Debian
architecture.)  I run the amd64 kernel flavour on i386 and I wouldn't be
able to use this module directly but I should still be able to build it
for some other kernel flavour.  The same problem can occur with an i386
chroot on an amd64 build host.

Ben.

#651780#25
Date:
2011-12-12 15:16:36 UTC
From:
To:
No, modules should not have to be built on the same system that will use
them.  (I can accept that they have to be built on the same Debian
architecture.)  I run the amd64 kernel flavour on i386 and I wouldn't be
able to use this module directly but I should still be able to build it
for some other kernel flavour.  The same problem can occur with an i386
chroot on an amd64 build host.

Ben.

#651780#30
Date:
2011-12-13 18:32:24 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
sl-modem, which is due to be installed in the Debian FTP archive:

sl-modem-daemon_2.9.11~20110321-5_amd64.deb
  to non-free/s/sl-modem/sl-modem-daemon_2.9.11~20110321-5_amd64.deb
sl-modem_2.9.11~20110321-5.debian.tar.gz
  to non-free/s/sl-modem/sl-modem_2.9.11~20110321-5.debian.tar.gz
sl-modem_2.9.11~20110321-5.dsc
  to non-free/s/sl-modem/sl-modem_2.9.11~20110321-5.dsc



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 651780@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
أحمد المحمودي (Ahmed El-Mahmoudy) <aelmahmoudy@sabily.org> (supplier of updated sl-modem package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)
Format: 1.8
Date: Tue, 13 Dec 2011 20:21:32 +0200
Source: sl-modem
Binary: sl-modem-source sl-modem-daemon
Architecture: source amd64
Version: 2.9.11~20110321-5
Distribution: unstable
Urgency: low
Maintainer: أحمد المحمودي (Ahmed El-Mahmoudy) <aelmahmoudy@sabily.org>
Changed-By: أحمد المحمودي (Ahmed El-Mahmoudy) <aelmahmoudy@sabily.org>
Description:
 sl-modem-daemon - SmartLink software modem daemon
 sl-modem-source - SmartLink software modem driver - module building source
Closes: 648844 651780 651781
Changes:
 sl-modem (2.9.11~20110321-5) unstable; urgency=low
 .
   * Added Brazilian Portuguese debconf templates translation (Closes: #648844)
   * Added device_create_changes.diff patch to fix device_create call for linux
     kernel >= 2.6.27 (Closes: #651781)
   * Added arch64.diff patch to enhance architecture detection login in
     Makefile. Thanks to Ben Hutchings <ben@decadent.org.uk> (Closes: #651780)
   * debian/copyright: Updated copyright format & years.
Checksums-Sha1:
 6409e2834e3824d33250dc335066481799dec1c8 2008 sl-modem_2.9.11~20110321-5.dsc
 aeabab47344007fe6ea6e2a5f6e92ca169073bb1 37182 sl-modem_2.9.11~20110321-5.debian.tar.gz
 bc7dde81b61fa26ed55354aab52fe280d709fcce 524790 sl-modem-daemon_2.9.11~20110321-5_amd64.deb
Checksums-Sha256:
 84aded82fc89494e63aca4c0b521cfa106ccb96325d25df2a1e62f5d881b9108 2008 sl-modem_2.9.11~20110321-5.dsc
 2e68f9455ebe4354487e7b939883bd40c5310a74bf07bc00f152f58645e8418a 37182 sl-modem_2.9.11~20110321-5.debian.tar.gz
 9a2adcd1216587e17a85791570b818b9419db2e75fac56efe70850d63016c159 524790 sl-modem-daemon_2.9.11~20110321-5_amd64.deb
Files:
 75008bf6a3ca8c5d84d6c1333acb0508 2008 non-free/misc optional sl-modem_2.9.11~20110321-5.dsc
 3a6ffc767fcbe4679a3f1abe969f1b96 37182 non-free/misc optional sl-modem_2.9.11~20110321-5.debian.tar.gz
 586154e1b320ae200f2606e5332d2527 524790 non-free/misc optional sl-modem-daemon_2.9.11~20110321-5_amd64.deb
iQEcBAEBCAAGBQJO55kXAAoJELwZapTt3aG3AxoIAJ9U7weZDlPNf6ZhN1VH8tFn
d0Y+49EPQ+UPTsrKHT9tlYePkjBCRNijwpgTm95oCoo6jMzjtCtfu/FUzph8bqlO
MEP6f0P+vfgbC6+KxAYwC1RHS3uyhMX08r/51ExBPdmV7zEQ25RdppguipP0Iq4j
PiulKhs7bnldUj3PJ4GbwExpG+EZbZSOdny/yphO5/zMhjpaVm8PlChBPqZcMHXL
PlI8ihJD1bVzNP4evi9xe6ejmg0hn1KSRW+MbRmh7bEXj4kT5Vrh/fd/oJEKxd4O
JWf/GVvKwPrvscb9dzgsEDSc8rdb14vv1EbTsLG2BcSbYsWeK3dZL9zoi78jlWk=
=EJqP
-----END PGP SIGNATURE-----

#651780#37
Date:
2011-12-14 04:31:24 UTC
From:
To:
Sorry, no it isn't.  You have to test for CONFIG_X86_32 inside of
Kbuild, and you can't use uname for this anywhere.  Really, the Makefile
needs a thorough cleanup.

Also, building for a 64-bit kernel will still fail since DKMS is
configured to expect all 3 modules to be built.

I've attached a debdiff that seems to fix all of this.  Feel free to
reword and cherry-pick from the patches.

Ben.

#651780#42
Date:
2011-12-14 12:34:18 UTC
From:
To:
Can you further explain this please ?

Actually, I don't want to remove the 2.4.x kernel support.

Actually sl-modem-source is only for i386 arch, but your dkms.conf patch
is wonderful, I didn't know that it was possible, I have cherry-picked
this patch already, and hence made sl-modem-source available for amd64
arch too.

#651780#47
Date:
2011-12-14 15:10:09 UTC
From:
To:
On Wed, 2011-12-14 at 14:34 +0200, أحمد المحمودي (Ahmed El-Mahmoudy) wrote:

1. You run 'make' in the drivers directory.
2. This invokes the kernel build system (Kbuild).
3. Kbuild includes the Makefile from the drivers directory again.

Steps 1 and 3 can be distinguished by whether KERNELRELEASE is defined.
At step 3, CONFIG_X86_32 is defined or not, as appropriate.  At step 1,
you can't tell.  Testing uname is no good because that tells you about
the host kernel and not the target kernel.

Well, you could include $(KERNEL_DIR)/.config at step 1.

Whyever not?

Well the USB driver ought to work on any architecture, right?

Ben.

#651780#52
Date:
2011-12-17 04:52:29 UTC
From:
To:
Ok, the reason I did the patch this way is that CONFIG_X86_32 was only
defined on kernel >= 2.6.14, so I needed a way to detect the target
kernel for kernel < 2.6.14, that is in order to create a patch suitable
for upstream.

  Well, I'm not sure if upstream will accept a patch that removes 2.4.x
  kernel support, and if upstream doesn't accept it, I'm not willing to
  maintain such a patch.

  Maybe. But as far as I know, the sl-modem-daemon package (which is
  what will make use of the driver) would only work on x86 archs because
  of the binary blob:

  modem/dsplibs.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped

#651780#57
Date:
2011-12-17 05:37:54 UTC
From:
To:
On Sat, 2011-12-17 at 06:52 +0200, أحمد المحمودي (Ahmed El-Mahmoudy) wrote:

Hmm, I thought it was older than that.  (At work, I look after a module
that gets backported as far as 2.6.9 - but no further.)

Oh well, you wouldn't be the first maintainer with a crazy upstream.

Sorry, I didn't see that dependency.  It should have been obvious there
was still a blob somewhere.  But an x86_64 module and i386 daemon should
work, right?  (In fact, in theory, it should be possible to use a native
module and run the daemon in qemu-i386 on any other architecture.  But
that's a *really* marginal case.)

Ben.