File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed
Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -16,3 +16,9 @@ rustflags = [
1616CFLAGS = " -D_FORTIFY_SOURCE=0"
1717CXXFLAGS = " -D_FORTIFY_SOURCE=0"
1818
19+ # Alpine Linux (musl) configuration
20+ # ext-php-rs requires dynamic CRT linking for musl to work properly
21+ [target .'cfg(target_env = "musl")' ]
22+ rustflags = [" -C" , " target-feature=-crt-static" ]
23+
24+
Original file line number Diff line number Diff line change 3232 @echo " make ci - Run all CI checks locally"
3333 @echo " "
3434 @echo " Cross-platform builds:"
35- @echo " make build-linux - Build for Linux"
35+ @echo " make build-linux - Build for Linux (glibc) "
3636 @echo " make build-macos - Build for macOS"
3737 @echo " make build-windows - Build for Windows"
38+ @echo " make build-musl - Build for Alpine/musl (debug)"
39+ @echo " make build-musl-release - Build for Alpine/musl (release)"
3840 @echo " "
3941 @echo " Current platform: $( UNAME_S) "
4042 @echo " Extension file: $( EXT_FILE) "
@@ -160,3 +162,16 @@ build-windows:
160162
161163build-windows-release :
162164 cargo build --release --target x86_64-pc-windows-msvc
165+
166+ # Build for musl (Alpine Linux) with dynamic CRT linking
167+ build-musl :
168+ @echo " Building for musl (Alpine Linux) - debug mode..."
169+ @echo " Note: Requires clang-dev and llvm-dev packages"
170+ LIBCLANG_PATH=/usr/lib \
171+ cargo build --target x86_64-unknown-linux-musl
172+
173+ build-musl-release :
174+ @echo " Building for musl (Alpine Linux) - release mode..."
175+ @echo " Note: Requires clang-dev and llvm-dev packages"
176+ LIBCLANG_PATH=/usr/lib \
177+ cargo build --release --target x86_64-unknown-linux-musl
You can’t perform that action at this time.
0 commit comments