Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Is there a way to modify GNU Linker Error Parser options for a headless build?
Is there a way to modify GNU Linker Error Parser options for a headless build? [message #1855519] Wed, 19 October 2022 10:51
John McCabe is currently offline John McCabeFriend
Messages: 228
Registered: July 2009
Senior Member
Hi,

We're currently using the CDT headless builder to build our managed projects under Jenkins. We've recently added an extra dependency which gives us a slight issue when we're doing a cross-build for an ARM target.

Basically, at the link stage, we get a load of warnings showing "invalid string offset" and this causes the build to be marked as a failure, even though the executable is created and runs fine.

I've searched for more details on this and it seems like it's due to a bug in GNU binutils prior to 2.33; while the warning is emitted, it sounds like it's a false warning. A patch to fix the problem was created here - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=baf46cd78048e1b959462567556e1de1ef6b9039.

Unfortunately, we're not in a position at the moment, to update to a newer version of binutils but, when I uses the Eclipse UI, I can modify the "GNU Linker Error Parser" options to add a pattern that looks like this:

(.*[/\\])?ld(\.exe)?: (.*\.so): (invalid string offset) (.*) (for section .strtab')


and set it to "Ignore" so that the build does not get marked as a failure. While this isn't ideal, it does for the moment (and testing should find whether any issues genuinely arise as a result).

However, I don't know how or if I can change that setting when running a headless build. Is this possible? If so, can someone please help me by suggesting how to do it, or where I can find the details of how to?

I can see a list of command line options to the headless build application in a couple of places but the documentation on a number of those options seems rather sparse.

Many thanks.


UPDATE

I can see, from the CDT sources, that the changes to the GNU Linker Error Parser settings are stored to a file called model.extensions.xml in the .metadata/.plugins/org.eclipse.cdt.core directory of the workspace. That file is loaded in the ErrorParserExtensionsManager class, in loadUserDefinedErrorParsers(), but I can't see any way of injecting any relevant settings into it from the command line.

One potential option would be to keep a copy of that file and, once the workspace is created from the headless build, but before building any projects, push that copy into the relevant place. It's unpleasant, but appears to work.

Does anyone know an alternative?

We have a long-term plan to try to move to CMake-based projects, but that may take a little time.

[Updated on: Thu, 20 October 2022 12:55]

Report message to a moderator

Previous Topic:"No rule to make file" after moving a directory
Next Topic:Breakpoint problem
Goto Forum:
  


Current Time: Tue Apr 30 07:29:31 GMT 2024

Powered by FUDForum. Page generated in 0.03626 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top