Skip to main content

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

I couldn't immediately see from the line of code highlighted how that was the problem, but if you provide a patch I will work with you to get it merged. We are about to release CDT 9.9.0, but we can very soon after release 9.9.1, so no need to wait long. 

Jonah 

On Thu., Sep. 12, 2019, 15:07 Liviu Ionescu, <ilg@xxxxxxxxxx> wrote:
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



_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

Back to the top