configure: Determine system architecture properly on *BSD systems#2012
configure: Determine system architecture properly on *BSD systems#2012Dead2 merged 1 commit intozlib-ng:developfrom
Conversation
|
I came across this as I was wondering why a part of the script was not being run And later noticed the amd64 fix to enable the intrinsics support on OpenBSD and FreeBSD. |
WalkthroughWhen CHOST is not set, Changes
Sequence Diagram(s)sequenceDiagram
participant Configure as configure
participant Sys as System (uname)
participant Logic as ARCH Logic
Configure->>Sys: uname -s
Sys-->>Configure: OS_NAME
alt OS_NAME matches BSD/DragonFly (case-insensitive)
Configure->>Sys: uname -p
Sys-->>Configure: PROC_NAME
Configure->>Logic: set ARCH = PROC_NAME
else other non-cross
Configure->>Sys: uname -m
Sys-->>Configure: MACHINE
Configure->>Logic: set ARCH = MACHINE
end
Note over Logic: Normalize ARCH aliases
Logic->>Logic: treat "amd64" as "x86_64" in case checks
Logic-->>Configure: ARCH determined (used in later conditionals)
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
configure(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: mtl1979
Repo: zlib-ng/zlib-ng PR: 1904
File: arch/riscv/Makefile.in:12-14
Timestamp: 2025-04-15T09:20:52.333Z
Learning: Optional feature flags in Makefile.in templates should default to empty strings. The configure script should detect feature support and update these variables accordingly during the configuration process.
📚 Learning: 2025-04-15T09:20:52.333Z
Learnt from: mtl1979
Repo: zlib-ng/zlib-ng PR: 1904
File: arch/riscv/Makefile.in:12-14
Timestamp: 2025-04-15T09:20:52.333Z
Learning: Optional feature flags in Makefile.in templates should default to empty strings. The configure script should detect feature support and update these variables accordingly during the configuration process.
Applied to files:
configure
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (41)
- GitHub Check: macOS Clang ASAN (ARM64)
- GitHub Check: Windows MSVC 2022 v141 Win64
- GitHub Check: Windows MSVC ARM No Test
- GitHub Check: EL10 Clang S390X DFLTCC MSAN
- GitHub Check: macOS Clang ASAN (ARM64)
- GitHub Check: Windows MSVC 2022 v141 Win64
- GitHub Check: Windows MSVC ARM No Test
- GitHub Check: EL10 Clang S390X DFLTCC MSAN
- GitHub Check: macOS Clang ASAN (ARM64)
- GitHub Check: Windows MSVC 2022 v141 Win64
- GitHub Check: Windows MSVC ARM No Test
- GitHub Check: EL10 Clang S390X DFLTCC MSAN
- GitHub Check: macOS Clang ASAN (ARM64)
- GitHub Check: Windows MSVC 2022 v141 Win64
- GitHub Check: Windows MSVC ARM No Test
- GitHub Check: EL10 Clang S390X DFLTCC MSAN
- GitHub Check: macOS Clang ASAN (ARM64)
- GitHub Check: Windows MSVC 2022 v141 Win64
- GitHub Check: Windows MSVC ARM No Test
- GitHub Check: EL10 Clang S390X DFLTCC MSAN
- GitHub Check: macOS Clang ASAN (ARM64)
- GitHub Check: Windows MSVC 2022 v141 Win64
- GitHub Check: Windows MSVC ARM No Test
- GitHub Check: EL10 Clang S390X DFLTCC MSAN
- GitHub Check: macOS Clang ASAN (ARM64)
- GitHub Check: Windows MSVC 2022 v141 Win64
- GitHub Check: Windows MSVC ARM No Test
- GitHub Check: EL10 Clang S390X DFLTCC MSAN
- GitHub Check: macOS Clang ASAN (ARM64)
- GitHub Check: Windows MSVC 2022 v141 Win64
- GitHub Check: Windows MSVC ARM No Test
- GitHub Check: EL10 Clang S390X DFLTCC MSAN
- GitHub Check: macOS Clang ASAN (ARM64)
- GitHub Check: Windows MSVC 2022 v141 Win64
- GitHub Check: Windows MSVC ARM No Test
- GitHub Check: EL10 Clang S390X DFLTCC MSAN
- GitHub Check: macOS Clang ASAN (ARM64)
- GitHub Check: Windows MSVC 2022 v141 Win64
- GitHub Check: Windows MSVC ARM No Test
- GitHub Check: EL10 Clang S390X DFLTCC MSAN
- GitHub Check: macOS GCC (ARM64)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #2012 +/- ##
===========================================
- Coverage 82.37% 81.29% -1.09%
===========================================
Files 163 163
Lines 12862 12862
Branches 3171 3171
===========================================
- Hits 10595 10456 -139
- Misses 1201 1347 +146
+ Partials 1066 1059 -7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I mean one of the AIs suggestions is something along what I had considered but was not sure which way to go. |
e3568ce to
2c9bf39
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
configure(3 hunks)
🔇 Additional comments (3)
configure (3)
42-42: LGTM: amd64 alias support added.Correctly treats
amd64(commonly used on BSD systems) as equivalent tox86_64for architecture detection. This aligns with the PR objective of properly handling BSD architecture names.
346-350: LGTM: Cross-compiler amd64 handling added.Correctly extends the cross-compiler architecture detection to recognize
amd64alongsidex86_64. The logic properly honors the--32build flag.
1803-1918: LGTM: amd64 included in x86 optimization path.Essential addition that ensures BSD systems with
ARCH=amd64correctly receive x86-specific optimizations (SSE2, AVX2, AVX512, etc.). Without this change, these systems would fall through to the generic architecture case and miss critical performance optimizations.
|
Also before and after on an OpenBSD/amd64 system.. |
uname -m on a BSD system will provide the architecture port .e.g. arm64, macppc, octeon instead of the machine architecture .e.g. aarch64, powerpc, mips64. uname -p will provide the machine architecture. NetBSD uses x86_64, OpenBSD uses amd64, FreeBSD is a mix between uname -p and the compiler output.
2c9bf39 to
cfa0ac2
Compare
uname -m on a BSD system will provide the architecture port .e.g.
arm64, macppc, octeon instead of the machine architecture .e.g.
aarch64, powerpc, mips64. uname -p will provide the machine
architecture. NetBSD uses x86_64, OpenBSD uses amd64, FreeBSD
is a mix between uname -p (amd64) and the compiler output (x86_64).