AdaCore / gprbuild

GPRbuild is an advanced build system designed to help automate the construction of multi-language systems.
Other
65 stars 21 forks source link

More helpful message for "warning: unable to locate objcopy"? #123

Closed Blady-Com closed 1 year ago

Blady-Com commented 1 year ago

When issuing warning: unable to locate objcopy, GPRBuild message references are confusing or at least not very helpful, for instance:

    14. library project Libadalang is
                        |
        >>> warning: unable to locate objcopy

or

gprname-process.adb:63:45: warning: unable to locate objcopy

Couldn't be a more detailed message about the operation which has produced the warning?

t-14 commented 1 year ago

Looks like the latter is due to bogus project location at the point this message is generated. Will suppress it.

Couldn't be a more detailed message about the operation which has produced the warning?

The operation is a check for objcopy, there is nothing more to that. It's not specific to a specific line in the project...

Blady-Com commented 1 year ago

I had a look on Check_Objtool function. It's used twice only in an if condition expression, line 2349:

                           if not Check_Objtool
                             (Objcopy_Exec, "objcopy")
                             or else not Check_Objtool
                               (Objdump_Exec, "objdump")

1) If objcopy is found then Objcopy_Exec is set by Check_Objtool, but Objcopy_Exec is never used after!? 2) If objcopy is found then the expression after or else is not executed thus Objdump_Exec is not set whereas it is used after at line 2494!?

Is it expected?

t-14 commented 1 year ago

This looks extremely suspicious, especially part (2), I agree! Should probably at the very least be just "or", but possibly objcopy check should just be removed. I'll review the code.

simonjwright commented 1 year ago

@Blady-Com didn't mention that they're using a Mac, which is why there's no objcopy; and in any case the use gprbuild proposes to make of it in building a static SAL is impossible on macOS because mach-o binaries don't support it.