Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Cannot get broadcom-sta to compile
View unanswered posts
View posts from last 24 hours

Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message

Joined: 10 Nov 2012
Posts: 5
Location: Altamonte Springs, FL

PostPosted: Sat Nov 01, 2014 9:54 pm    Post subject: [SOLVED] Cannot get broadcom-sta to compile Reply with quote


I am attempting to get the broadcom-sta driver to compile so that I may use the built-in wireless on my laptop as opposed to using USB tethering on my phone (which is currently the only solution that is working for me).

Here are the various outputs that portage recommends for support (please let me know if I should provide more information!)

➜  ~  emerge --info '=net-wireless/broadcom-sta-'
Portage 2.2.14 (python 2.7.8-final-0, default/linux/amd64/13.0/desktop/gnome/systemd, gcc-4.9.2, glibc-2.19-r1, 3.17.2-gentoo x86_64)
                         System Settings
System uname: Linux-3.17.2-gentoo-x86_64-Intel-R-_Core-TM-_i7-4960HQ_CPU_@_2.60GHz-with-gentoo-2.2
KiB Mem:    16354396 total,  10289948 free
KiB Swap:          0 total,         0 free
Timestamp of tree: Sat, 01 Nov 2014 14:00:01 +0000
ld GNU ld (Gentoo 2.24 p1.4) 2.24
app-shells/bash:          4.3_p30
dev-lang/perl:            5.20.1-r2
dev-lang/python:          2.7.8, 3.3.5-r1, 3.4.1
dev-util/cmake:           3.0.2
dev-util/pkgconfig:       0.28-r2
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.13.2
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.14.1
sys-devel/binutils:       2.24-r3
sys-devel/gcc:            4.9.2
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.3-r1
sys-devel/make:           4.1-r1
sys-kernel/linux-headers: 3.17-r1 (virtual/os-headers)
sys-libs/glibc:           2.19-r1
Repositories: gentoo gnome
ACCEPT_KEYWORDS="amd64 ~amd64"
CFLAGS="-march=native -mtune=native -fomit-frame-pointer -O2 -pipe"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -mtune=native -fomit-frame-pointer -O2 -pipe"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
USE="X a52 aac acl acpi alsa amd64 berkdb bindist bluetooth branding bzip2 cairo cdda cdr cli colord cracklib crypt cups cxx dbus dri dts dvd dvdr eds emboss encode evo exif experimental fam firefox flac fortran gdbm gif glamor gnome gnome-keyring gnome-online-accounts gpm gstreamer gtk iconv infinality introspection ipv6 jpeg lcms ldap libnotify libsecret mad mmx mng modules mp3 mp4 mpeg multilib nautilus ncurses nls nptl ogg opengl openmp pam pango pcre pdf png policykit ppds pulseaudio qt3support readline sdl session socialweb spell sse sse2 ssl startup-notification svg symlink systemd tcpd tiff truetype udev udisks unicode upower usb vim-syntax vorbis wxwidgets x264 xcb xml xv xvid zlib zsh-completion" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en en_US" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"

➜  ~  emerge -pqv '=net-wireless/broadcom-sta-'
[ebuild  N    ] net-wireless/broadcom-sta-

 * IMPORTANT: 9 news items need reading for repository 'gentoo'.
 * Use eselect news to read news items.

➜  ~  sudo cat /var/tmp/portage/net-wireless/broadcom-sta-
 * Package:    net-wireless/broadcom-sta-
 * Repository: gentoo
 * Maintainer:
 * USE:        abi_x86_64 amd64 elibc_glibc kernel_linux userland_GNU
 * FEATURES:   preserve-libs sandbox userpriv usersandbox
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found kernel object directory:
 *     /lib/modules/3.17.2-gentoo/build
 * Found sources for kernel version:
 *     3.17.2-gentoo
 * Checking for suitable kernel configuration options...                                                                                                                                                                                                                               [ ok ]
>>> Unpacking source...
>>> Unpacking hybrid-v35_64-nodebug-pcoem-6_30_223_248.tar.gz to /var/tmp/portage/net-wireless/broadcom-sta-
>>> Unpacking README-broadcom-sta- to /var/tmp/portage/net-wireless/broadcom-sta-
unpack README-broadcom-sta- file format not recognized. Ignoring.
>>> Source unpacked in /var/tmp/portage/net-wireless/broadcom-sta-
>>> Preparing source in /var/tmp/portage/net-wireless/broadcom-sta- ...
 * Applying broadcom-sta- ...                                                                                                                                                                                                                                [ ok ]
 * Applying broadcom-sta- ...                                                                                                                                                                                                                               [ ok ]
 * Applying broadcom-sta- ...                                                                                                                                                                                                                            [ ok ]
 * Applying broadcom-sta- ...                                                                                                                                                                                                                                    [ ok ]
 * Applying broadcom-sta- ...                                                                                                                                                                                                                             [ ok ]
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/net-wireless/broadcom-sta- ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/net-wireless/broadcom-sta- ...
ln: failed to create symbolic link ‘Module.symvers’: File exists
 * Preparing wl module
make -j8 HOSTCC=x86_64-pc-linux-gnu-gcc CROSS_COMPILE=x86_64-pc-linux-gnu- 'LDFLAGS=-m elf_x86_64' -C /usr/src/linux M=/var/tmp/portage/net-wireless/broadcom-sta- wl.ko
make: Entering directory '/usr/src/linux-3.17.2-gentoo'
CFG80211 API is prefered for this kernel version
Using CFG80211 API
  CC [M]  /var/tmp/portage/net-wireless/broadcom-sta-
  CC [M]  /var/tmp/portage/net-wireless/broadcom-sta-
  CC [M]  /var/tmp/portage/net-wireless/broadcom-sta-
  CC [M]  /var/tmp/portage/net-wireless/broadcom-sta-
/var/tmp/portage/net-wireless/broadcom-sta- In function ‘wl_alloc_linux_if’:
/var/tmp/portage/net-wireless/broadcom-sta- error: macro "alloc_netdev" requires 4 arguments, but only 3 given
  dev = alloc_netdev(sizeof(priv_link_t), intf_name, ether_setup);
/var/tmp/portage/net-wireless/broadcom-sta- error: ‘alloc_netdev’ undeclared (first use in this function)
  dev = alloc_netdev(sizeof(priv_link_t), intf_name, ether_setup);
/var/tmp/portage/net-wireless/broadcom-sta- note: each undeclared identifier is reported only once for each function it appears in
/var/tmp/portage/net-wireless/broadcom-sta- In function ‘wl_dump_ver’:
/var/tmp/portage/net-wireless/broadcom-sta- error: macro "__DATE__" might prevent reproducible builds [-Werror=date-time]
/var/tmp/portage/net-wireless/broadcom-sta- error: macro "__TIME__" might prevent reproducible builds [-Werror=date-time]
/var/tmp/portage/net-wireless/broadcom-sta- In function ‘wl_cfg80211_get_key’:
/var/tmp/portage/net-wireless/broadcom-sta- warning: passing argument 1 of ‘memcpy’ discards ‘const’ qualifier from pointer target type
  memcpy(params.key,, params.key_len);
In file included from ./arch/x86/include/asm/string.h:4:0,
                 from include/linux/string.h:17,
                 from include/linux/dynamic_debug.h:111,
                 from include/linux/printk.h:260,
                 from include/linux/kernel.h:13,
                 from ./arch/x86/include/asm/percpu.h:44,
                 from ./arch/x86/include/asm/preempt.h:5,
                 from include/linux/preempt.h:18,
                 from include/linux/spinlock.h:50,
                 from include/linux/seqlock.h:35,
                 from include/linux/time.h:5,
                 from include/linux/stat.h:18,
                 from include/linux/module.h:10,
                 from /var/tmp/portage/net-wireless/broadcom-sta-,
                 from /var/tmp/portage/net-wireless/broadcom-sta-
./arch/x86/include/asm/string_64.h:32:14: note: expected ‘void *’ but argument is of type ‘const u8 *’
 extern void *memcpy(void *to, const void *from, size_t len);
/var/tmp/portage/net-wireless/broadcom-sta- At top level:
/var/tmp/portage/net-wireless/broadcom-sta- warning: initialization from incompatible pointer type
  .get_station = wl_cfg80211_get_station,
/var/tmp/portage/net-wireless/broadcom-sta- warning: (near initialization for ‘wl_cfg80211_ops.get_station’)
cc1: some warnings being treated as errors
scripts/ recipe for target '/var/tmp/portage/net-wireless/broadcom-sta-' failed
make[1]: *** [/var/tmp/portage/net-wireless/broadcom-sta-] Error 1
make[1]: *** Waiting for unfinished jobs....
Makefile:1540: recipe for target 'wl.ko' failed
make: *** [wl.ko] Error 2
make: Leaving directory '/usr/src/linux-3.17.2-gentoo'
 * ERROR: net-wireless/broadcom-sta- failed (compile phase):
 *   emake failed
 * If you need support, post the output of `emerge --info '=net-wireless/broadcom-sta-'`,
 * the complete build log and the output of `emerge -pqv '=net-wireless/broadcom-sta-'`.
 * The complete build log is located at '/var/tmp/portage/net-wireless/broadcom-sta-'.
 * The ebuild environment file is located at '/var/tmp/portage/net-wireless/broadcom-sta-'.
 * Working directory: '/var/tmp/portage/net-wireless/broadcom-sta-'
 * S: '/var/tmp/portage/net-wireless/broadcom-sta-'

I am currently using Linux 3.17.2, and as far as I know it seems to be correctly configured with SSB and B43 disabled in the kernel. In addition, I have tried to install a few other versions of the broadcom-sta driver, as well as using it on Linux 3.16.7 (which has worked in the past).

Thanks for any help that you can provide!

Last edited by mconnolly on Sun Nov 02, 2014 8:07 pm; edited 1 time in total
Back to top
View user's profile Send private message

Joined: 10 Nov 2012
Posts: 5
Location: Altamonte Springs, FL

PostPosted: Sun Nov 02, 2014 8:06 pm    Post subject: Reply with quote

I was able to fix this by browsing through Debian's mailing list.

There, a user suggested a patch (which I modified slightly to work properly for portage's patch system).

Simply paste the following into the filename /etc/portage/patches/net-wireless/broadcom-sta/wl_linux.patch and emerge as normal.


--- src/wl/sys/wl_linux.c   2014-09-24 10:45:55.000000000 -0500
+++ src/wl/sys/wl_linux.c   2014-09-24 10:49:08.000000000 -0500
@@ -1309,7 +1309,12 @@
    dev->priv = priv_link;
-   dev = alloc_netdev(sizeof(priv_link_t), intf_name, ether_setup);
+      dev = alloc_netdev(sizeof(priv_link_t), intf_name, ether_setup);
+   #else
+      dev = alloc_netdev(sizeof(priv_link_t), intf_name, NET_NAME_UNKNOWN, ether_setup);
+   #endif
    if (!dev) {
       WL_ERROR(("wl%d: %s: alloc_netdev failed\n",
          (wl->pub)?wl->pub->unit:wlif->subunit, __FUNCTION__));

Note that I am using Linux version 3.17.2 and have tested this for broadcom-sta version I am also using amd64 as my architecture, so if you are on something else, your mileage may vary.

For more info, see this link which also has an i386 version (which you will have to change the paths on for it to work):
Back to top
View user's profile Send private message
Tux's lil' helper
Tux's lil' helper

Joined: 01 Apr 2005
Posts: 76
Location: Minneapolis, MN, USA

PostPosted: Thu Nov 06, 2014 5:34 am    Post subject: Reply with quote

Nice post!! Thanks so much for finding this patch and making it usable with portage. With gentoo-sources-3.17.2 amd64, I had the same problem, and tried your patch, but it was not able to be applied. I had to tweak the line numbers of the patch just so, and here's what worked for me:

--- src/wl/sys/wl_linux.c       2014-11-05 20:51:43.024639499 -0800
+++ src/wl/sys/wl_linux.c       2014-11-05 21:24:45.281415658 -0800
@@ -1308,7 +1308,13 @@
        dev->priv = priv_link;
        dev = alloc_netdev(sizeof(priv_link_t), intf_name, ether_setup);
+       dev = alloc_netdev(sizeof(priv_link_t), intf_name, NET_NAME_UNKNOWN, ether_setup);
        if (!dev) {
                WL_ERROR(("wl%d: %s: alloc_netdev failed\n",
                        (wl->pub)?wl->pub->unit:wlif->subunit, __FUNCTION__));
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum