0
votes

I'm trying to compile drivers from:
https://askubuntu.com/questions/630198/cant-compile-drivers-for-rt8188eu-wifi-card
(from that repository: https://github.com/lwfinger/rtlwifi_new.git)

not for Ubuntu but for OpenWRT instead (I'm compiling on Fedora 31).

I followed more or less the instructions from
https://telecnatron.com/articles/Cross-Compiling-For-OpenWRT-On-Linux/index.html and
http://botdream.com/blog/2013/11/24/setup-openwrt-cross-compile-environment/

I don't know much about compiling etc. and I got stuck with that error.

[james7bondo@localhost rtlwifi_new]$ make
make -C /lib/modules/5.3.16-300.fc31.x86_64/build M=/home/james7bondo/External/Programming/OpenWrt_Driver/rtlwifi_new modules
make[1]: Entering directory '/usr/src/kernels/5.3.16-300.fc31.x86_64'
  CC [M]  /home/james7bondo/External/Programming/OpenWrt_Driver/rtlwifi_new/btcoexist/halbtc8192e2ant.o
mipsel-openwrt-linux-gcc: error: unrecognized argument in option '-mtune=generic'
mipsel-openwrt-linux-gcc: note: valid arguments to '-mtune=' are: 10000 1004kc 1004kf 1004kf1_1 1004kf2_1 10k 12000 12k 14000 14k 16000 16k 2000 20kc 24kc 24kec 24kef 24kef1_1 24kef2_1 24kefx 24kex 24kf 24kf1_1 24kf2_1 24kfx 24kx 2k 3000 34kc 34kf 34kf1_1 34kf2_1 34kfx 34kn 34kx 3900 3k 4000 4100 4111 4120 4130 4300 4400 4600 4650 4700 4k 4kc 4kec 4kem 4kep 4km 4kp 4ksc 4ksd 5000 5400 5500 5900 5k 5kc 5kf 6000 6k 7000 74kc 74kf 74kf1_1 74kf2_1 74kf3_2 74kfx 74kx 7k 8000 8k 9000 9k from-abi i6400 interaptiv loongson2e loongson2f loongson3a m14k m14kc m14ke m14kec m4k m5100 m5101 mips1 mips2 mips3 mips32 mips32r2 mips32r3 mips32r5 mips32r6 mips4 mips64 mips64r2 mips64r3 mips64r5 mips64r6 native octeon octeon+ octeon2 octeon3 orion p5600 r10000 r1004kc r1004kf r1004kf1_1 r1004kf2_1 r10k r12000 r12k r14000 r14k r16000 r16k r2000 r20kc r24kc r24kec r24kef r24kef1_1 r24kef2_1 r24kefx r24kex r24kf r24kf1_1 r24kf2_1 r24kfx r24kx r2k r3000 r34kc r34kf r34kf1_1 r34kf2_1 r34kfx r34kn r34kx r3900 r3k r4000 r4100 r4111 r4120 r4130 r4300 r4400 r4600 r4650 r4700 r4k r4kc r4kec r4kem r4kep r4km r4kp r4ksc r4ksd r5000 r5400 r5500 r5900 r5k r5kc r5kf r6000 r6k r7000 r74kc r74kf r74kf1_1 r74kf2_1 r74kf3_2 r74kfx r74kx r7k r8000 r8k r9000 r9k rm7000 rm7k rm9000 rm9k sb1 sb1a sr71000 sr71k vr4100 vr4111 vr4120 vr4130 vr4300 vr5000 vr5400 vr5500 vr5k xlp xlr
mipsel-openwrt-linux-gcc: error: unrecognized command line option '-mno-sse'; did you mean '-fno-dse'?
mipsel-openwrt-linux-gcc: error: unrecognized command line option '-mno-mmx'; did you mean '-mno-mdmx'?
mipsel-openwrt-linux-gcc: error: unrecognized command line option '-mno-sse2'; did you mean '-fno-dse'?
mipsel-openwrt-linux-gcc: error: unrecognized command line option '-mno-3dnow'; did you mean '-mno-dsp'?
mipsel-openwrt-linux-gcc: error: unrecognized command line option '-mno-avx'; did you mean '-mno-eva'?
mipsel-openwrt-linux-gcc: error: unrecognized command line option '-m64'
mipsel-openwrt-linux-gcc: error: unrecognized command line option '-mno-80387'
mipsel-openwrt-linux-gcc: error: unrecognized command line option '-mno-fp-ret-in-387'
mipsel-openwrt-linux-gcc: error: unrecognized command line option '-mpreferred-stack-boundary=3'
mipsel-openwrt-linux-gcc: error: unrecognized command line option '-mskip-rax-setup'
mipsel-openwrt-linux-gcc: error: unrecognized command line option '-mno-red-zone'; did you mean '-fno-regmove'?
mipsel-openwrt-linux-gcc: error: unrecognized command line option '-mcmodel=kernel'
mipsel-openwrt-linux-gcc: error: unrecognized command line option '-mindirect-branch=thunk-extern'
mipsel-openwrt-linux-gcc: error: unrecognized command line option '-mindirect-branch-register'
mipsel-openwrt-linux-gcc: error: unrecognized command line option '-mrecord-mcount'; did you mean '-frecord-marker=4'?
mipsel-openwrt-linux-gcc: error: unrecognized command line option '-mfentry'; did you mean '--entry'?
make[3]: *** [scripts/Makefile.build:281: /home/james7bondo/External/Programming/OpenWrt_Driver/rtlwifi_new/btcoexist/halbtc8192e2ant.o] Error 1
make[2]: *** [scripts/Makefile.build:497: /home/james7bondo/External/Programming/OpenWrt_Driver/rtlwifi_new/btcoexist] Error 2
make[1]: *** [Makefile:1630: _module_/home/james7bondo/External/Programming/OpenWrt_Driver/rtlwifi_new] Error 2
make[1]: Leaving directory '/usr/src/kernels/5.3.16-300.fc31.x86_64'
make: *** [Makefile:58: all] Error 2

The command mips-openwrt-linux-gcc from the website doesn't work, I use mipsel-openwrt-linux-gcc instead. I don't know whether that makes any difference.

In the Makefile I changed the line CC = gcc for CC = mipsel-openwrt-linux-gcc

I would be grateful for any help. I don't whether the Makefile has to be edited or I should change something about the compiler.

1
You have to have a correct cross toolchain.0andriy

1 Answers

0
votes

Export the architecture.
Example, for arm:

export ARCH=arm