Skip to content

Fix hrw4u and hrw_confcmp build on GCC/Linux#1

Merged
zwoop merged 1 commit intozwoop:Hrw4uCPPfrom
bneradt:Hrw4uCPP_build_fixes
Feb 17, 2026
Merged

Fix hrw4u and hrw_confcmp build on GCC/Linux#1
zwoop merged 1 commit intozwoop:Hrw4uCPPfrom
bneradt:Hrw4uCPP_build_fixes

Conversation

@bneradt
Copy link

@bneradt bneradt commented Feb 17, 2026

The hrw4u code was developed on macOS with Clang, which is lenient about C++20 designated initializer ordering and missing fields. GCC enforces these strictly: designators must appear in struct declaration order, and skipped fields trigger -Wmissing-field-initializers (fatal under -Werror). Fix Tables.cc by reordering all designators to match MapParams field order, Error.cc by adding the skipped .code field, and suppress the missing-field warning for the hrw4u target. Also add fPIC and ANTLR4 shared library fallback for systems without the static ANTLR4 library.

The hrw_confcmp tool had three link failures on GNU ld: hrw_confcmp_lib was missing its dependency on hrw_confcmp_parser (which provides Parser and HRWSimpleTokenizer symbols), the CertBase::SAN::SANBase::Join stub returned std::string instead of cripts::string (different mangled name), and GNU ld's single-pass archive processing missed intra-library symbol references that macOS ld resolves automatically.

(cherry picked from commit df0ed61c784f193a945a35a68e4f98a7ce59b503)

The hrw4u code was developed on macOS with Clang, which is lenient about
C++20 designated initializer ordering and missing fields. GCC enforces
these strictly: designators must appear in struct declaration order, and
skipped fields trigger -Wmissing-field-initializers (fatal under -Werror).
Fix Tables.cc by reordering all designators to match MapParams field order,
Error.cc by adding the skipped .code field, and suppress the missing-field
warning for the hrw4u target. Also add fPIC and ANTLR4 shared library
fallback for systems without the static ANTLR4 library.

The hrw_confcmp tool had three link failures on GNU ld: hrw_confcmp_lib
was missing its dependency on hrw_confcmp_parser (which provides Parser
and HRWSimpleTokenizer symbols), the CertBase::SAN::SANBase::Join stub
returned std::string instead of cripts::string (different mangled name),
and GNU ld's single-pass archive processing missed intra-library symbol
references that macOS ld resolves automatically.

(cherry picked from commit df0ed61c784f193a945a35a68e4f98a7ce59b503)
@zwoop zwoop merged commit 5654b5c into zwoop:Hrw4uCPP Feb 17, 2026
zwoop pushed a commit that referenced this pull request Feb 17, 2026
The hrw4u code was developed on macOS with Clang, which is lenient about
C++20 designated initializer ordering and missing fields. GCC enforces
these strictly: designators must appear in struct declaration order, and
skipped fields trigger -Wmissing-field-initializers (fatal under -Werror).
Fix Tables.cc by reordering all designators to match MapParams field order,
Error.cc by adding the skipped .code field, and suppress the missing-field
warning for the hrw4u target. Also add fPIC and ANTLR4 shared library
fallback for systems without the static ANTLR4 library.

The hrw_confcmp tool had three link failures on GNU ld: hrw_confcmp_lib
was missing its dependency on hrw_confcmp_parser (which provides Parser
and HRWSimpleTokenizer symbols), the CertBase::SAN::SANBase::Join stub
returned std::string instead of cripts::string (different mangled name),
and GNU ld's single-pass archive processing missed intra-library symbol
references that macOS ld resolves automatically.

(cherry picked from commit df0ed61c784f193a945a35a68e4f98a7ce59b503)
zwoop pushed a commit that referenced this pull request Feb 19, 2026
The hrw4u code was developed on macOS with Clang, which is lenient about
C++20 designated initializer ordering and missing fields. GCC enforces
these strictly: designators must appear in struct declaration order, and
skipped fields trigger -Wmissing-field-initializers (fatal under -Werror).
Fix Tables.cc by reordering all designators to match MapParams field order,
Error.cc by adding the skipped .code field, and suppress the missing-field
warning for the hrw4u target. Also add fPIC and ANTLR4 shared library
fallback for systems without the static ANTLR4 library.

The hrw_confcmp tool had three link failures on GNU ld: hrw_confcmp_lib
was missing its dependency on hrw_confcmp_parser (which provides Parser
and HRWSimpleTokenizer symbols), the CertBase::SAN::SANBase::Join stub
returned std::string instead of cripts::string (different mangled name),
and GNU ld's single-pass archive processing missed intra-library symbol
references that macOS ld resolves automatically.

(cherry picked from commit df0ed61c784f193a945a35a68e4f98a7ce59b503)
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.

2 participants

Comments