[build2] Executable ELF files not installed with executable file mode

Matthew Krupcale mkrupcale at matthewkrupcale.com
Sun Sep 16 18:28:16 UTC 2018

On Sun, Sep 16, 2018 at 11:06 AM, Boris Kolpackov
<boris at codesynthesis.com> wrote:

> It is a bit more elaborate (and not yet completely documented) than
> this: a target type (library, executable) may specify a custom mode with
> install.mode. If it is not specifies, then the default is taken
> from the directory's .mode value where the target is installed which
> itself can be overridden with config.install.*.mode.

If the user does not specify target install.mode and specifies the
install directory mode 755 for /usr/lib64, will static libraries
installed here still have mode 644 (as they should)? I noticed lines

install_mode<liba> (bs, "644");

in build2/build2/bin/init.cxx and was wondering how this worked.

Is the target-type-specific install.mode specified in the buildfile
and/or root.build file(s)? If so, this is quite general and powerful.

> Yes, this normally happens automatically. I think it doesn't work for
> you because you've overridden all the installation locations explicitly
> but did not specify the desired mode for them:

Okay, makes sense. The reason I specify them is because I'm defining a
macro similar to what is done in RPM %configure macro[1] for

> You either need to add something like:
> config.install.bin.mode=755

Thus, this is what I have done.

> Or, perhaps better, rely on the default locations and modes[1] and
> only tweak what's different:

If both the target type install.mode and the directory mode e.g.
config.install.bin.mode are not specified, what will the default mode
be? Is the default mode target-type dependent?

Thanks for the help and sorry for my misunderstanding / oversimplification.


[1] https://github.com/rpm-software-management/rpm/blob/ddb32b9187e9ce85819a84ca8d202131fd9f8b9f/macros.in#L1008

More information about the users mailing list