Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error on Fedora 35 #995

Open
bfnserra opened this issue Jan 31, 2022 · 11 comments
Open

Build error on Fedora 35 #995

bfnserra opened this issue Jan 31, 2022 · 11 comments

Comments

@bfnserra
Copy link

Hello Proxmark team !

I'm trying to build proxmark on fedora 35 (arm-none-eabi-gcc 11.1.0) and got the following error:

make[1]: Entering directory '/home/nico/applications/proxmark3/bootrom'
perl ../tools/mkversion.pl .. > version.c || cp ../common/default_version.c version.c
arm-none-eabi-gcc -c -I../include -I../common -I. -Wall -Werror -pedantic -std=c99 -I. -Os -mthumb -mthumb-interwork -o obj/version.o version.c 
arm-none-eabi-gcc -c -I../include -I../common -I. -Wall -Werror -pedantic -std=c99 -I. -Os -mthumb-interwork -o obj/ram-reset.o ram-reset.s
arm-none-eabi-gcc -c -I../include -I../common -I. -Wall -Werror -pedantic -std=c99 -I. -Os -mthumb-interwork -o obj/flash-reset.o flash-reset.s
arm-none-eabi-gcc -c -I../include -I../common -I. -Wall -Werror -pedantic -std=c99 -I. -Os -mthumb-interwork -o obj/string.o string.c 
arm-none-eabi-gcc -c -I../include -I../common -I. -Wall -Werror -pedantic -std=c99 -I. -Os -mthumb -mthumb-interwork -o obj/usb_cdc.o ../common/usb_cdc.c 
arm-none-eabi-gcc -c -I../include -I../common -I. -Wall -Werror -pedantic -std=c99 -I. -Os -mthumb -mthumb-interwork -o obj/bootrom.o bootrom.c 
bootrom.c: In function 'UsbPacketReceived':
bootrom.c:122:20: error: array subscript 'uint32_t {aka long unsigned int}[0]' is partly outside array bounds of 'char[1]' [-Werror=array-bounds]
  122 |           flash_mem[i] = c->d.asDwords[i];
      |           ~~~~~~~~~^~~
bootrom.c:22:43: note: while referencing '_flash_start'
   22 | extern char _bootrom_start, _bootrom_end, _flash_start, _flash_end;
      |                                           ^~~~~~~~~~~~
bootrom.c:114:10: error: array subscript 'uint32_t {aka volatile long unsigned int}[0]' is partly outside array bounds of 'char[1]' [-Werror=array-bounds]
  114 |         p[i+arg0] = c->d.asDwords[i];
      |         ~^~~~~~~~
bootrom.c:22:43: note: while referencing '_flash_start'
   22 | extern char _bootrom_start, _bootrom_end, _flash_start, _flash_end;
      |                                           ^~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [../common/Makefile.common:82: obj/bootrom.o] Error 1
make[1]: Leaving directory '/home/nico/applications/proxmark3/bootrom'
make: *** [Makefile:29: bootrom/all] Error 2

Here is information about arm-none-eabi-gcc:

~ » arm-none-eabi-gcc -v
Using built-in specs.
COLLECT_GCC=arm-none-eabi-gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/arm-none-eabi/11.1.0/lto-wrapper
Target: arm-none-eabi
Configured with: ../gcc-11.1.0/configure --prefix=/usr --mandir=/usr/share/man --with-pkgversion='Fedora 11.1.0-2.fc35' --with-bugurl=https://bugzilla.redhat.com/ --infodir=/usr/share/info --target=arm-none-eabi --enable-interwork --enable-multilib --with-python-dir=share/arm-none-eabi/gcc-11.1.0/python --with-multilib-list=rmprofile --enable-plugins --disable-decimal-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-tls --enable-languages=c,c++ --with-newlib --disable-nls --disable-shared --disable-threads --with-gnu-as --with-gnu-ld --with-gmp --with-mpfr --with-mpc --with-headers=yes --with-system-zlib --with-sysroot=/usr/arm-none-eabi
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 11.1.0 (Fedora 11.1.0-2.fc35) 

Thanks in advance for your help !

@aldemarf
Copy link

aldemarf commented Feb 4, 2022

Same problem here. [Manjaro / kernel 5.16]

❯ arm-none-eabi-gcc -v
Using built-in specs.
COLLECT_GCC=arm-none-eabi-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-none-eabi/11.2.0/lto-wrapper
Target: arm-none-eabi
Configured with: /build/arm-none-eabi-gcc/src/gcc-11.2.0/configure --target=arm-none-eabi --prefix=/usr --with-sysroot=/usr/arm-none-eabi --with-native-system-header-dir=/include --libexecdir=/usr/lib --enable-languages=c,c++ --enable-plugins --disable-decimal-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-tls --with-gnu-as --with-gnu-ld --with-system-zlib --with-newlib --with-headers=/usr/arm-none-eabi/include --with-python-dir=share/gcc-arm-none-eabi --with-gmp --with-mpfr --with-mpc --with-isl --with-libelf --enable-gnu-indirect-function --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-pkgversion='Arch Repository' --with-bugurl=https://bugs.archlinux.org/ --with-multilib-list=rmprofile
Thread model: single
Supported LTO compression algorithms: zlib zstd
gcc version 11.2.0 (Arch Repository)

@pwpiwi
Copy link
Contributor

pwpiwi commented Feb 8, 2022

How did you manage to come that far? I am already stuck at compiling version.c:

arm-none-eabi-gcc -c -I../include -I../common -I. -Wall -Werror -pedantic -std=c99 -I. -Os -mthumb -mthumb-interwork -o obj/version.o version.c 
In file included from ../include/usb_cmd.h:21,
                 from ../include/proxmark3.h:17,
                 from version.c:1:
/usr/lib/gcc/arm-none-eabi/11.1.0/include/stdint.h:9:16: fatal error: stdint.h: No such file or directory
    9 | # include_next <stdint.h>
      |                ^~~~~~~~~~
compilation terminated.

@bfnserra
Copy link
Author

bfnserra commented Feb 9, 2022

@pwpiwi - looks like you have a different error, probably related to some dependencies... ?
I googled "stdint.h: No such file or directory" and found some interesting things, hope it helps !

@pwpiwi
Copy link
Contributor

pwpiwi commented Feb 10, 2022

@bnfserra: sudo dnf install arm-none-eabi-newlib fixed my issue on Fedora. I now can confirm your issue. Looking into it..

@bfnserra
Copy link
Author

In the meantime, I was able to start playing via docker : docker run -it --device="/dev/ttyACM0" --privileged -v /tmp/share:/opt/proxmark3/Data iceman1001/proxmark3:1.7.0
Hope it helps.

@crazyquark
Copy link

I made these changes to have it compile:
ee8491b

@AndreKR
Copy link

AndreKR commented Oct 29, 2022

Same issue (array subscript 'uint32_t {aka long unsigned int}[0]' is partly outside array bounds of 'char[1]') on Windows following these instructions.

@iceman1001
Copy link
Member

you can also try https://github.com/rfidresearchgroup/proxmark3 which is a more up-to-date client / firmware for your proxmark3

@AndreKR
Copy link

AndreKR commented Oct 29, 2022

The changes from @crazyquark's commit solved the issue.

@nyetwurk
Copy link

This is not the way you're supposed to use linker defined symbols.
It should be

extern uint8_t _bootrom_start[], _bootrom_end[], _flash_start[], _flash_end[];

@nyetwurk
Copy link

https://github.com/rfidresearchgroup/proxmark3 has

extern uint32_t _bootrom_start[], _bootrom_end[], _flash_start[], _flash_end[], _osimage_entry[];

that makes a ton more sense. thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants