Navigation Menu

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

PIO cuts .a when -l: option used #3574

Closed
puzrin opened this issue Jun 24, 2020 · 8 comments
Closed

PIO cuts .a when -l: option used #3574

puzrin opened this issue Jun 24, 2020 · 8 comments
Assignees
Labels

Comments

@puzrin
Copy link

puzrin commented Jun 24, 2020

Configuration

Operating system: Ubuntu 18.04LTS

PlatformIO Version (platformio --version): 4.4.0a3

Description of problem

If i need to link library without lib prefix, via -l: option, i have to type double .a.a at the name end:

-Lhal/stm32g473rc_usb_pd/stm32cube/Middlewares/ST/STM32_USBPD_Library/Core/lib
-l:USBPDCORE_PD3_CONFIG_1_CM4_wc32.a.a

Reference: https://community.platformio.org/t/failing-to-link-external-library/14544/3?u=vit

Steps to Reproduce

Actual Results

Have to add one more .a to library name: -l:USBPDCORE_PD3_CONFIG_1_CM4_wc32.a.a

Expected Results

Expect to use full name, as recommended at SO:

-l:USBPDCORE_PD3_CONFIG_1_CM4_wc32.a
@valeros
Copy link
Member

valeros commented Jun 26, 2020

It looks like SCons is not aware of this syntax, so it might be a good idea to raise an issue in their repository.
@puzrin Is there any official/reliable source of documentation for this feature besides a post on SO?

@puzrin
Copy link
Author

puzrin commented Jun 26, 2020

@valeros i don't know, i use c/cpp for hobby only - almost no experience.

@ivankravets
Copy link
Member

I'm not sure that we can fix this issue. We use SCons as a build system.

@puzrin what is a reason that you can't use lib prefix for the archive?

@puzrin
Copy link
Author

puzrin commented Jun 29, 2020

See https://github.com/puzrin/reflow_micro/tree/master/hal/stm32g473rc_usb_pd/stm32cube

It's auto-generated by CubeMX (usb pd middleware driver). I keep hal in separate folder, and don't touch there anything by hand. This simplifies maintenance when something should be changed.

PS. I don't use built-in hal because need more fresh and more complete version with mw.

@puzrin
Copy link
Author

puzrin commented Jul 2, 2020

I'd suggest to remove .a magic as non standard... But, for compatibility, you could apply it only to -l, excluding -l:.

@ivankravets
Copy link
Member

Please file an issue at https://github.com/SCons/scons/issues and make reference to this issue. Thanks!

@puzrin
Copy link
Author

puzrin commented Jul 3, 2020

@ivankravets you asked about official docs of :. From ld man https://linux.die.net/man/1/ld:

If namespec is of the form :filename, ld will search the library path for a file called filename, otherwise it will search the library path for a file called libnamespec.a.


Please file an issue at SCons/scons/issues and make reference to this issue. Thanks!

Cold you do it yourself? I don't know how to explain that problem is on their side & create a minimal sample.

@ivankravets
Copy link
Member

We don't manipulate with library names or strip them. Please file an issue at https://github.com/SCons/scons/issues.
We will discuss together with SCons Team what to do in this case.

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

No branches or pull requests

3 participants