Skip to content

Add FreeBSD build support#7

Merged
zombocoder merged 1 commit intomainfrom
feature/freebsd-support
Oct 6, 2025
Merged

Add FreeBSD build support#7
zombocoder merged 1 commit intomainfrom
feature/freebsd-support

Conversation

@zombocoder
Copy link
Owner

Enable BFC to build successfully on FreeBSD by addressing platform-specific compiler requirements and API differences.

Changes:

  • Add -mcrc32 flag for CRC32 intrinsics on x86_64/amd64 architectures
  • Detect FreeBSD's 'amd64' architecture identifier (in addition to x86_64/AMD64)
  • Fix unused parameter warning in bfc_os_advise_nocache() on FreeBSD
  • Fix benchmark_encrypt.c to use correct reader API (bfc_reader_set_encryption_password)
  • Update documentation to mention FreeBSD support and pkgconf requirement

Technical details:

  • FreeBSD's Clang requires both -msse4.2 and -mcrc32 for mm_crc32* intrinsics
  • CMAKE_SYSTEM_PROCESSOR returns "amd64" on FreeBSD (not "x86_64")
  • Changed from set_source_files_properties to target_compile_options for proper flag application

Tested on FreeBSD 14.3-RELEASE with Clang 19.1.7.

Enable BFC to build successfully on FreeBSD by addressing platform-specific
compiler requirements and API differences.

Changes:
- Add -mcrc32 flag for CRC32 intrinsics on x86_64/amd64 architectures
- Detect FreeBSD's 'amd64' architecture identifier (in addition to x86_64/AMD64)
- Fix unused parameter warning in bfc_os_advise_nocache() on FreeBSD
- Fix benchmark_encrypt.c to use correct reader API (bfc_reader_set_encryption_password)
- Update documentation to mention FreeBSD support and pkgconf requirement

Technical details:
- FreeBSD's Clang requires both -msse4.2 and -mcrc32 for _mm_crc32_* intrinsics
- CMAKE_SYSTEM_PROCESSOR returns "amd64" on FreeBSD (not "x86_64")
- Changed from set_source_files_properties to target_compile_options for proper flag application

Tested on FreeBSD 14.3-RELEASE with Clang 19.1.7.
@zombocoder zombocoder merged commit 717a40b into main Oct 6, 2025
9 checks passed
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.

1 participant