Skip to content

configure.ac: support static toolchains when compiling with hardening#3561

Open
winterqt wants to merge 1 commit intotpm2-software:masterfrom
winterqt:push-rkukwrtswtoy
Open

configure.ac: support static toolchains when compiling with hardening#3561
winterqt wants to merge 1 commit intotpm2-software:masterfrom
winterqt:push-rkukwrtswtoy

Conversation

@winterqt
Copy link
Copy Markdown

It's not clear to me why -shared was added to the hardening flags in the first place, but unconditionally adding it breaks compilation with hardening enabled (the default).

It's not clear to me why `-shared` was added to the hardening flags in
the first place, but unconditionally adding it breaks compilation with
hardening enabled (the default).

Signed-off-by: Winter M <winter@antithesis.com>
@winterqt
Copy link
Copy Markdown
Author

cc @thesamesam since I saw you in the log for configure.ac -- might want to pick ;-)

@winterqt
Copy link
Copy Markdown
Author

winterqt commented Feb 25, 2026

CI failure doesn't look related(?) nvm, I see e21f8ab and 4a87504 now.

Comment thread configure.ac
Comment on lines +327 to +330
AC_ARG_ENABLE([shared],
AS_HELP_STRING([--disable-shared], [don't build shared libraries]),,
[enable_shared="yes"]
)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's a chance that we want to move this outside of the hardened conditional?

Comment thread configure.ac
[enable_shared="yes"]
)
AS_IF([test x"$enable_shared" != x"no"], [
add_hardened_ld_flag([[-shared]])
Copy link
Copy Markdown
Contributor

@thesamesam thesamesam Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO we should drop this entirely: that would fix your problem too.

The project already uses libtool which has machinery for shared and static linking. It is not really a hardening flag at all other than "shared libraries are good" (and I like them!)

@AndreasFuchsTPM
Copy link
Copy Markdown
Member

I'm fine in either case.
Could you rebase to latest master and make changes you like.
I'm about to do an rc0 of the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants