Found the solution here, I was building the kernel module with the wrong gcc version. I was using gcc version 4.9 instead of the original gcc-4.8 from Ubuntu LTS Trusty 14.04.5 :
$ sudo update-alternatives --config gcc Il existe 5 choix pour l'alternative gcc (qui fournit /usr/bin/gcc). Sélection Chemin Priorité État ------------------------------------------------------------ * 0 /usr/bin/gcc-4.9 60 mode automatique 1 /usr/bin/gcc-4.8 60 mode manuel 2 /usr/bin/gcc-4.9 60 mode manuel 3 /usr/bin/gcc-5 60 mode manuel 4 /usr/bin/gcc-6 60 mode manuel 5 /usr/bin/gcc-7 60 mode manuel Appuyez sur <Entrée> pour conserver la valeur par défaut[*] ou choisissez le numéro sélectionné :1 update-alternatives: utilisation de « /usr/bin/gcc-4.8 » pour fournir « /usr/bin/gcc » (gcc) en mode manuel Therefore I choose (1) for gcc-4.8 and run : $ sudo dkms remove bcmwl/6.30.223.248+bdcom -k $(uname -r) -------- Uninstall Beginning -------- Module: bcmwl Version: 6.30.223.248+bdcom Kernel: 4.4.0-121-generic (x86_64) ------------------------------------- Status: Before uninstall, this module version was ACTIVE on this kernel. wl.ko: - Uninstallation - Deleting from: /lib/modules/4.4.0-121-generic/updates/dkms/ - Original module - No original module was found for this module on this kernel. - Use the dkms install command to reinstall any previous module version. depmod.... DKMS: uninstall completed. ------------------------------ Deleting module version: 6.30.223.248+bdcom completely from the DKMS tree. ------------------------------ Done. $ sudo dkms install bcmwl/6.30.223.248+bdcom -k $(uname -r) Creating symlink /var/lib/dkms/bcmwl/6.30.223.248+bdcom/source -> /usr/src/bcmwl-6.30.223.248+bdcom DKMS: add completed. Kernel preparation unnecessary for this kernel. Skipping... applying patch 0001-MODULE_LICENSE.patch...patching file src/wl/sys/wl_linux.c Hunk #1 succeeded at 156 (offset -3 lines). applying patch 0002-Makefile.patch...patching file Makefile Hunk #1 succeeded at 113 with fuzz 1. Hunk #2 succeeded at 132 with fuzz 2 (offset 1 line). applying patch 0003-Make-up-for-missing-init_MUTEX.patch...patching file src/wl/sys/wl_linux.c Hunk #1 succeeded at 111 with fuzz 2 (offset 12 lines). applying patch 0010-change-the-network-interface-name-from-eth-to-wlan.patch...patching file src/wl/sys/wl_linux.c Hunk #1 succeeded at 221 (offset -14 lines). applying patch 0011-do-not-define-__devinit-as-__init-in-linux-3.8-as- __.patch...patching file src/include/linuxver.h applying patch 0012-add-support-for-Linux-3.15.patch...patching file src/wl/sys/wl_cfg80211_hybrid.c Hunk #1 succeeded at 2071 (offset 230 lines). applying patch 0013-gcc.patch...patching file Makefile applying patch 0014-add-support-for-Linux-3.17.patch...patching file src/wl/sys/wl_linux.c Hunk #1 succeeded at 1313 (offset -38 lines). applying patch 0015-add-support-for-Linux-3.18.patch...patching file src/wl/sys/wl_cfg80211_hybrid.c applying patch 0016-repair-make-warnings.patch...patching file src/wl/sys/wl_cfg80211_hybrid.c applying patch 0017-add-support-for-Linux-4.0.patch...patching file src/wl/sys/wl_cfg80211_hybrid.c applying patch 0018-cfg80211_disconnected.patch...patching file src/wl/sys/wl_cfg80211_hybrid.c Hunk #1 succeeded at 2072 (offset 25 lines). applying patch 0019-broadcom-sta-6.30.223.248-3.18-null-pointer-fix.patch...patching file src/wl/sys/wl_linux.c Hunk #1 succeeded at 2168 (offset 11 lines). Building module: cleaning build area.... make KERNELRELEASE=4.4.0-121-generic -C /lib/modules/4.4.0-121-generic/build M=/var/lib/dkms/bcmwl/6.30.223.248+bdcom/build....... cleaning build area.... DKMS: build completed. wl.ko: Running module version sanity check. - Original module - No original module exists within this kernel - Installation - Installing to /lib/modules/4.4.0-121-generic/updates/dkms/ depmod.... DKMS: install completed. $ sudo modprobe -v wl insmod /lib/modules/4.4.0-121-generic/updates/dkms/wl.ko $ echo $? 0 $ lsmod | grep -w wl wl 6365184 0 cfg80211 561152 1 wl -- You received this bug notification because you are a member of Kernel Packages, which is subscribed to bcmwl in Ubuntu. https://bugs.launchpad.net/bugs/1766993 Title: dpkg-reconfigure bcmwl-kernel-source : modprobe: ERROR: could not insert 'wl': Exec format error Status in bcmwl package in Ubuntu: New Bug description: Hi, The bcmwl driver cannot be build upon the linux-header v4.4.0-121-generic : $ sudo dpkg-reconfigure bcmwl-kernel-source [sudo] password for sebastien: Removing all DKMS Modules Done. Loading new bcmwl-6.30.223.248+bdcom DKMS files... Building only for 4.4.0-121-generic Building for architecture x86_64 Building initial module for 4.4.0-121-generic Done. wl: Running module version sanity check. - Original module - No original module exists within this kernel - Installation - Installing to /lib/modules/4.4.0-121-generic/updates/dkms/ depmod.... DKMS: install completed. modprobe: ERROR: could not insert 'wl': Exec format error update-initramfs: deferring update (trigger activated) Traitement des actions différées (« triggers ») pour initramfs-tools (0.103ubuntu4.10) ... update-initramfs: Generating /boot/initrd.img-4.4.0-121-generic Traitement des actions différées (« triggers ») pour shim-signed (1.32~14.04.2+0.9+1474479173.6c180c6-1ubuntu1) ... Secure Boot not enabled on this system. ProblemType: Bug DistroRelease: Ubuntu 14.04 Package: bcmwl-kernel-source 6.30.223.248+bdcom-0ubuntu0.2 ProcVersionSignature: Ubuntu 4.4.0-121.145~14.04.1-generic 4.4.117 Uname: Linux 4.4.0-121-generic x86_64 ApportVersion: 2.14.1-0ubuntu3.27 Architecture: amd64 CurrentDesktop: KDE Date: Thu Apr 26 00:03:47 2018 InstallationDate: Installed on 2016-09-22 (580 days ago) InstallationMedia: Kubuntu 14.04.5 LTS "Trusty Tahr" - Release amd64 (20160803) SourcePackage: bcmwl UpgradeStatus: No upgrade log present (probably fresh install) To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/bcmwl/+bug/1766993/+subscriptions -- Mailing list: https://launchpad.net/~kernel-packages Post to : kernel-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~kernel-packages More help : https://help.launchpad.net/ListHelp