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

Building errors with cmake 3.22 #859

Closed
1 task done
Riksu9000 opened this issue Dec 3, 2021 · 8 comments
Closed
1 task done

Building errors with cmake 3.22 #859

Riksu9000 opened this issue Dec 3, 2021 · 8 comments
Labels
bug Something isn't working

Comments

@Riksu9000
Copy link
Contributor

Riksu9000 commented Dec 3, 2021

Verification

  • I searched for similar bug reports and found none was relevant.

What happened?

Build fails with cmake 3.22 but works with 3.21.4

What should happen instead?

No response

Reproduction steps

Install cmake 3.22 -> make pinetime-mcuboot-app

More details?

At first I got errors regarding missing includes in Ppg.h which doesn't occur with version 3.21.4 (This might be a separate issue affecting develop). After fixing those, the build failed during linking. Downgrading to 3.21.4 fixed the issue.

[ 64%] Linking CXX executable pinetime-mcuboot-app-1.7.1.out
/usr/lib/gcc/arm-none-eabi/11.2.0/../../../../arm-none-eabi/bin/ld: cannot find -lgcc_s
/usr/lib/gcc/arm-none-eabi/11.2.0/../../../../arm-none-eabi/bin/ld: cannot find -lgcc_s
collect2: error: ld returned 1 exit status
make[3]: *** [src/CMakeFiles/pinetime-mcuboot-app.dir/build.make:1813: src/pinetime-mcuboot-app-1.7.1.out] Error 1
make[2]: *** [CMakeFiles/Makefile2:252: src/CMakeFiles/pinetime-mcuboot-app.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:259: src/CMakeFiles/pinetime-mcuboot-app.dir/rule] Error 2
make: *** [Makefile:189: pinetime-mcuboot-app] Error 2

There might be two separate issues here.

Version

develop

Companion app

No response

@Riksu9000 Riksu9000 added the bug Something isn't working label Dec 3, 2021
@NeroBurner
Copy link
Contributor

I'm currently using the following gcc version: gcc-arm-none-eabi-9-2020-q2-update and nRF5 sdk nRF5_SDK_15.3.0_59ac345 and it still builds for me with CMake 3.22.0

@Avamander
Copy link
Collaborator

You are using /usr/lib/gcc/arm-none-eabi/11.2.0/ instead of the correct compiler.

@Riksu9000
Copy link
Contributor Author

You are using /usr/lib/gcc/arm-none-eabi/11.2.0/ instead of the correct compiler.

Using the recommended version makes no difference

/home/riku/gcc-arm/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld: cannot find -lgcc_s
/home/riku/gcc-arm/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld: cannot find -lgcc_s
collect2: error: ld returned 1 exit status
make[3]: *** [src/CMakeFiles/pinetime-mcuboot-app.dir/build.make:1813: src/pinetime-mcuboot-app-1.7.1.out] Error 1
make[2]: *** [CMakeFiles/Makefile2:252: src/CMakeFiles/pinetime-mcuboot-app.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:259: src/CMakeFiles/pinetime-mcuboot-app.dir/rule] Error 2
make: *** [Makefile:163: pinetime-mcuboot-app] Error 2

@Riksu9000 Riksu9000 reopened this Dec 4, 2021
@Avamander
Copy link
Collaborator

Nothing in CMake 3.22.0's release notes would indicate they changed its behaviour.

Very much seems specific to your setup or cmake build.

@Avamander
Copy link
Collaborator

Not being able to find static stdlib to link against is not InfiniTime's problem until any evidence provided would indicate otherwise.

@NeroBurner
Copy link
Contributor

@Riksu9000 have you tried completely deleting the build directory and doing a fresh cmake-configure and build?

@Riksu9000
Copy link
Contributor Author

Deleting the build directory and reconfiguring fixed the issue and I can no longer reproduce it. I have no idea why that happened. Sorry for any confusion.

@JF002
Copy link
Collaborator

JF002 commented Dec 6, 2021

@Riksu9000 I also recently had issues with building the project. I figured that adding set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) before the project() line in the main CMake file would help. I'm not sure why, but couldn't analyze that deeper.

Also, I checkout many differents branches and mostly this one. I probably failed one stash at some point, and couldn't build develop again (it couldn't find references to many ble functions). It turns out that the changes in the config file of lvgl.conf were still present in my working copy after the checkout to develop. Once I reset the changes, it would build again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants