RfidResearchGroup / proxmark3

Iceman Fork - Proxmark3
http://www.icedev.se
GNU General Public License v3.0
4.08k stars 1.07k forks source link

Unable to compile on fedora 35 #1524

Closed damnms closed 3 years ago

damnms commented 3 years ago

its not possible to build proxmark client for fedora 35

Describe the bug

[oli@fedora ~]$ cd proxmark3
[oli@fedora proxmark3]$ make

===================================================================
Version info:      RRG/Iceman/master/v4.14434-63-g30d71a60f
Platform name:     Proxmark3 RDV4
PLATFORM:          PM3RDV4
PLATFORM_FPGA:     xc2s30
PLATFORM_SIZE:     512
Platform extras:   No extra selected
Included options:  SMARTCARD FLASH -DRDV4 LF HITAG EM4x50 EM4x70 ISO15693 LEGICRF ISO14443b ISO14443a ICLASS FELICA NFCBARCODE HFSNIFF HFPLOT
Standalone mode:   LF_SAMYRUN
===================================================================
[*] MAKE client/all
===================================================================
Version info:      RRG/Iceman/master/v4.14434-63-g30d71a60f
Client platform:   Linux
GUI support:       QT4 found, enabled ()
native BT support: Bluez not found, disabled
Jansson library:   system library not found, using local library
Lua library:       system library not found, using local library
Python3 library:   Python3 v3.10 found, enabled
Readline library:  enabled
Whereami library:  system library not found, using local library
Lua SWIG:          wrapper found
Python SWIG:       wrapper found
compiler version:  gcc (GCC) 11.2.1 20210728 (Red Hat 11.2.1-1)
===================================================================
[*] MAKE deps/amiitool/libamiibo.a
make[2]: Für das Ziel „all“ ist nichts zu tun.
[*] MAKE deps/cliparser/libcliparser.a
PLATFORM Linux
make[2]: Für das Ziel „all“ ist nichts zu tun.
[*] MAKE deps/hardnested/libhardnested.a
make[2]: Für das Ziel „all“ ist nichts zu tun.
[*] MAKE deps/liblua/liblua.a for linux
make[3]: Für das Ziel „all“ ist nichts zu tun.
[*] MAKE deps/jansson/libjansson.a
make[2]: Für das Ziel „all“ ist nichts zu tun.
[*] MAKE obj/libmbedtls.a
make[2]: Für das Ziel „all“ ist nichts zu tun.
[*] MAKE deps/reveng/libreveng.a
make[2]: Für das Ziel „all“ ist nichts zu tun.
[*] MAKE deps/tinycbor/tinycbor.a
make[2]: Für das Ziel „all“ ist nichts zu tun.
[*] MAKE deps/whereami/libwhereami.a
make[2]: Für das Ziel „all“ ist nichts zu tun.
[*] MAKE bootrom/all
compiler version:  arm-none-eabi-gcc (Fedora 11.1.0-0.fc35) 11.1.0
[=] LD obj/bootrom.elf
/usr/lib/gcc/arm-none-eabi/11.1.0/../../../../arm-none-eabi/bin/ld: cannot find -lgcc
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:55: obj/bootrom.elf] Fehler 1
make: *** [Makefile:131: bootrom/all] Fehler 2

To Reproduce Steps to reproduce the behavior:

  1. git clone https://github.com/RfidResearchGroup/proxmark3.git
  2. cd proxmark3 && make

Expected behavior that everything compiles fine

Screenshots

Desktop (please complete the following information):

(*) Q factor must be measured without tag on the antenna

[+] Displaying LF tuning graph. Divisor 88 (blue) is 134,83 kHz, 95 (red) is 125,00 kHz.



**Additional context**
iceman1001 commented 3 years ago

Looks like your cross compilation setup isn't correct. Did you follow the instructions https://github.com/RfidResearchGroup/proxmark3/blob/master/doc/md/Installation_Instructions/Linux-Installation-Instructions.md ?

damnms commented 3 years ago

yes i did, and iirc it was working with fedora 34, so it might be a problem with fedora's cross compile package, but i am not sure.

iceman1001 commented 3 years ago

https://wiki.osdev.org/GCC_Cross-Compiler

 ld: cannot find -lgcc

You specified that you want to link the GCC low-level runtime library into your executable through the -lgcc' switch, but forgot to build and properly install the library.
If you got no warnings or errors while installing libgcc and you still have problems you can copy the library in your project and link it with -L. -lgcc
The libgcc is at $PREFIX/lib/gcc/$TARGET/<gcc-version>/libgcc.a . 

I doubt its a pm3 source code issue. Could be that Fedora35 needs another instruction how to setup its dev-env...

doegox commented 3 years ago

Quite a rabbit hole because there are issues to get Fedora 35 running in Docker but the "good" news is that I managed to get a Fedora 35 running in my Docker and I could reproduce the bug. I suspect a missing cross-compiler library, still investigating...

doegox commented 3 years ago

Hmm there seems to be no arm-none-eabi libgcc.a packaged for Fedora 35, even in another package. In comparison, the same arm-none-eabi-gcc package from Archlinux (https://archlinux.org/packages/community/x86_64/arm-none-eabi-gcc/) contains properly the libgcc.a so it seems to be more a problem of Fedora than a problem of recent arm-none-eabi versions. What you can do, as a workaround, is to take the libgcc.a from Arch. I tested it, using libgcc.a from v11.2 and compiling the fw with Fedora gcc 11.1, flashing, it didn't brick my proxmark but still be prudent and avoid touching the bootrom if not needed.

doegox commented 3 years ago

BTW someone opened a bugreport on Fedora for that : https://bugzilla.redhat.com/show_bug.cgi?id=2010474 Feel free to provide extra information, I won't create an account on Redhat Bugzolla myself. arm-none-eabi-gcc-cs-11.1.0-0.fc35.x86_64.rpm is missing all the usual target binary libs & stubs. Easy to see:

damnms commented 3 years ago

that someone was me, forgot to mention that bugreport, my bad.

many thanks for your effort, i really appreciate that! i will try that workaround later that day and update the fedora bugreport, thanks!!

edit: can confirm that workaround worked like a charm, again many thanks for your great help :)