2

I'm trying to compile a static binary of wpa_supplicant:

Latest - https://www.w1.fi/releases/wpa_supplicant-2.10.tar.gz

Other similar - https://github.com/blunderbuss-wctf/wacker/tree/master/wpa_supplicant-2.8

But I'm not able to achieve it.

I've read about launch ./configure --enable-static before compilation, but this project has no ./configure file.

After some googling, this is what I've tried:

-Add -static to the CFLAGS line (line 6) in Makefile

-Modifying LDDFLAGS line (line 118) to remove -rdynamic setting there -static

When I launch a file command over the resulting wpa_supplicant binary, it always says dynamically linked so it didn't work.

How can I do this?

OscarAkaElvis
  • 5,384
  • 4
  • 27
  • 51

1 Answers1

1

I was having the exact same problem when trying to compile a statically linked binary for wpa_supplicant, i ended up finding wifi_tools_static, there you can find scripts and instructions on how to build and generate fully static binaries for both wpa_supplicant and even iwd if you need to

I've ran the scripts provided by the repo linked above on an Alpine Docker container, and tested the generated binaries on a very minimal Linux system that i'm working on, containing only the kernel and some busybox utils, and it worked flawlessly, wpa_cli, wpa_passphrase and wpa_supplicant

henriquehbr
  • 1,063
  • 4
  • 20
  • 41
  • Thanks, but finally it was achieved using this: https://www.magicermine.com/trial.html – OscarAkaElvis Oct 05 '22 at 11:03
  • I tested that github repo you suggested before your post, and it worked compiling it with a very basic config file. If many options are added, more dependencies are needed and it started to crash a lot, but as I said in my last comment, it worked using that statifier – OscarAkaElvis Oct 05 '22 at 11:04
  • I'll try with ermine and see if it works for me, thanks for sharing – henriquehbr Oct 05 '22 at 14:20
  • yeah, but bear in mind that ermine tool is not free. You can compile the binary for free only for 15 days to test – OscarAkaElvis Oct 17 '22 at 10:16
  • I've gave it a try and the results were pretty good, but by being a proprietary software it ends up being a dealbreaker for me – henriquehbr Oct 17 '22 at 22:00