Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Library names with spaces fail

I know that it is highly unlikely for someone to use library names that include spaces, but this can happen when using dependent projects, and they have spaces in the project name, propagated down to the library name.

The problem is that libraries are passed to the linker tool via the LIBS environment variable, which is processed by `ensurePathIsGNUMakeTargetRuleCompatibleSyntax()` to escape spaces, but the code fails, because the libraries are prefixed by -l and the logic does not expect this.

For example in my case resulted lines like:

LIBS += -l"arm\ static\ lib\ spaces"

which fail, there should be no double quotes there, the escaped spaces are enough.


I identified the problem in GnuMakefileGenerator.java:

https://git.eclipse.org/c/cdt/org.eclipse.cdt.git/tree/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java#n4647

where the code expects the double quote only in the first position.

In GNU MCU Eclipse I hacked the class and override the function:

https://github.com/gnu-mcu-eclipse/eclipse-plugins/commit/e6de2688cbfd1883b70719d119a0be827e597e4f

but his is an ugly hack, it would be better to find a more general solution in the upstream CDT.


Regards,

Liviu





Back to the top