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

CMake Build Issue #22

Open
jpc0016 opened this issue Mar 4, 2022 · 1 comment
Open

CMake Build Issue #22

jpc0016 opened this issue Mar 4, 2022 · 1 comment

Comments

@jpc0016
Copy link

jpc0016 commented Mar 4, 2022

Thanks again for all you've done. I run into an issue in chapter 5 while building the project with cmake/make. It appears cmake will create files with a .obj extension instead of .o and can't figure out how this happens. Stack Overflow has not been helpful:

john@embedded:~/Desktop/arm-example$ cmake -S . -Bbuild
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/cc
-- The C compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/john/Desktop/arm-example/build
john@embedded:~/Desktop/arm-example$ cd build
john@embedded:~/Desktop/arm-example/build$ make
Scanning dependencies of target u-boot
[  0%] Built target u-boot
Scanning dependencies of target bare-metal
[ 33%] Building C object CMakeFiles/bare-metal.dir/src/cstart.c.obj
[ 66%] Building ASM object CMakeFiles/bare-metal.dir/src/startup.s.obj
[100%] Linking C executable bare-metal.elf
/usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/bin/ld: cannot find startup.o
collect2: error: ld returned 1 exit status
CMakeFiles/bare-metal.dir/build.make:112: recipe for target 'bare-metal.elf' failed
make[2]: *** [bare-metal.elf] Error 1
CMakeFiles/Makefile2:131: recipe for target 'CMakeFiles/bare-metal.dir/all' failed
make[1]: *** [CMakeFiles/bare-metal.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
@murdo-g
Copy link

murdo-g commented Apr 26, 2022

Just reached the same point myself. After chapter 04, line 14 of the linkscript is modified from:

startup.o (.vector_table)
to
*(.vector_table)

Updating my linkscript solved that error.

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

2 participants