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

Precompiled libraries include path doesn't include FPU variant #4454

Open
1 of 5 tasks
mike1808 opened this issue Nov 6, 2022 · 2 comments
Open
1 of 5 tasks

Precompiled libraries include path doesn't include FPU variant #4454

mike1808 opened this issue Nov 6, 2022 · 2 comments
Labels
enhancement ldf Library Dependency Finder
Milestone

Comments

@mike1808
Copy link

mike1808 commented Nov 6, 2022

What kind of issue is this?

  • Question.
    This issue tracker is not the place for questions. If you want to ask how to do something,
    or to understand why something isn't working the way you expect it to,
    use Community Forums or Premium Support

  • PlatformIO IDE.
    All issues related to PlatformIO IDE should be reported to appropriate repository:
    PlatformIO IDE for Atom or
    PlatformIO IDE for VSCode

  • Development Platform or Board.
    All issues (building, uploading, adding new boards, etc.) related to PlatformIO development platforms
    should be reported to appropriate repository related to your hardware
    https://github.com/topics/platformio-platform

  • Feature Request.
    Start by telling us what problem you’re trying to solve. Often a solution
    already exists! Don’t send pull requests to implement new features without first getting our
    support. Sometimes we leave features out on purpose to keep the project small.

  • PlatformIO Core.
    If you’ve found a bug, please provide an information below.

You can erase any parts of this template not applicable to your Issue.


Configuration

Operating system: Linux workstation 5.15.71-1-MANJARO

PlatformIO Version (platformio --version): PlatformIO Core, version 6.1.6a

Description of problem

Some precompiled arduino libraries have the FPU variant in the source and include the library depending on it.
For instance, Adafruit nRFCrypto library has `fpv4-sp-d16-hard

Steps to Reproduce

  1. Create a new project with nrf52 platform and Arduino framework and add nRFCrypto to the depedencies:
[env:nrf52]
platform = nordicnrf52
board = adafruit_feather_nrf52840
framework = arduino
lib_deps = 
  adafruit/Adafruit nRFCrypto@^0.0.7
  1. Compile

Actual Results

Fails to link:

Linking .pio/build/adafruit_feather_nrf52840/firmware.elf
/home/USER/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld: cannot find -lnrf_cc310_0.9.13-no-interrupts
collect2: error: ld returned 1 exit status
*** [.pio/build/xiaonrf_adafruit/firmware.elf] Error 1

Expected Results

To successfully link.

If problems with PlatformIO Build System:

The content of platformio.ini:

[env:nrf52]
platform = nordicnrf52
board = adafruit_feather_nrf52840
framework = arduino
lib_deps = 
	adafruit/Adafruit nRFCrypto@^0.0.7```

**Source file to reproduce issue:**
```cpp
Insert here...

Additional info

@maxgerhardt
Copy link
Contributor

maxgerhardt commented Nov 9, 2022

Related: #4056

Offending code:

if self._manifest.get("precompiled") in ("true", "full"):
# add to LDPATH {build.mcu} folder
board_config = self.env.BoardConfig()
for key in ("build.mcu", "build.cpu"):
libpath = os.path.join(self.src_dir, board_config.get(key, ""))
if not os.path.isdir(libpath):
continue
self.env.PrependUnique(LIBPATH=libpath)
break
ldflags = [flag for flag in ldflags if flag] # remove empty
return " ".join(ldflags) if ldflags else None

Doesn't work with https://github.com/adafruit/Adafruit_nRFCrypto/blob/master/library.properties and src/cortex-m4/fpv4-sp-d16-hard/libnrf_cc310_0.9.13-no-interrupts.a

@ivankravets ivankravets added this to the 6.1.6 milestone Nov 9, 2022
@ivankravets ivankravets added bug ldf Library Dependency Finder enhancement and removed bug labels Nov 9, 2022
@ivankravets ivankravets modified the milestones: 6.1.6, 6.2 Jan 14, 2023
@maxgerhardt
Copy link
Contributor

maxgerhardt commented Jan 19, 2024

I think another user just hit this in https://community.platformio.org/t/motionfx-library-compile-failed-under-the-pio-but-success-under-arduino-ide/37975/3?u=maxgerhardt: With

[env:nucleo_f401re]
platform = ststm32
board = nucleo_f401re
framework = arduino
lib_deps = 
   stm32duino/STM32duino MotionFX @ ^1.1.0

it does not work out of the box either, it doesn't link in the the right library at all (no -lMotionFX) and from the wrong folder (just src/cortex-m4 instead of the right src/cortex-m4/fpv4-sp-d16-hard in this case).

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

No branches or pull requests

3 participants