Skip to content

Commit 57fe032

Browse files
Various arm64 and bootstrap-on-FreeBSD fixes (#427)
* comment out conflicting define * add msgSendv for aarch64 from Zoe * Fix arm64 build after llvm 18.1.3 upgrade Apparently clang 18 has become more strict about using floating point registers in inline assembly when -mgeneral-regs-only is used. This causes sys/arm64/arm64/vfp.c to fail to compile, with "error: instruction requires: fp-armv8", and "error: expected readable system register". To fix it, similar to other files compiled for arm64, disable -mgeneral-regs-only for this particular file. PR: 276104 MFC after: 1 month (cherry picked from commit f4d93b6) * bump to libpng 1.6.43 * disable NEON in libpixman * neon is apparently broken (it's disabled even in upstream ports) * dunno if `-DPIXMAN_TIMERS` is important, but had to turn it off * use MACHINE_ARCH rather than MACHINE in zsh build * skip intel files on arm64 * make sure PATH is set to find bootstrapped python3 * disable some mesa drivers that make linux assumptions * install is called anyway, put the symlinks in there * fix mesa build on arm * don't build docs --------- Co-authored-by: Dimitry Andric <[email protected]>
1 parent 4a0a6fe commit 57fe032

File tree

300 files changed

+20928
-16106
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

300 files changed

+20928
-16106
lines changed

Frameworks/AppKit/gperf/configure

+2-5
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ enable_option_checking
632632
ac_precious_vars='build_alias
633633
host_alias
634634
target_alias'
635-
ac_subdirs_all='lib src tests doc'
635+
ac_subdirs_all='lib src tests'
636636

637637
# Initialize some variables set by options.
638638
ac_init_help=
@@ -1729,7 +1729,7 @@ fi
17291729

17301730

17311731

1732-
subdirs="$subdirs lib src tests doc"
1732+
subdirs="$subdirs lib src tests"
17331733

17341734

17351735
extrasub="$extrasub"'
@@ -1744,9 +1744,6 @@ p
17441744
g
17451745
s/@subdir@/tests/
17461746
p
1747-
g
1748-
s/@subdir@/doc/
1749-
p
17501747
d
17511748
}
17521749
'

Frameworks/Foundation/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,8 @@ LDFLAGS+= ${FMWK_LDFLAGS} \
746746

747747
.if ${MACHINE_CPUARCH} == "aarch64"
748748
CFLAGS += -DCOCOTRON_DISALLOW_FORWARDING=1
749-
SRCS += NSObject/objc_msg_sendv-Disabled.m
749+
# SRCS += NSObject/objc_msg_sendv-Disabled.m
750+
SRCS += NSObject/platform_linux/msgSendv-aarch64.s
750751
.elif ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
751752
SRCS += NSObject/platform_linux/msgSendv-x64.s
752753
.endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
.section .text
2+
3+
.global _objc_msgSendv
4+
5+
_objc_msgSendv:
6+
// Prologue
7+
stp x29, x30, [sp, #-16]! // Save frame pointer and link register
8+
mov x29, sp // Set up frame pointer
9+
10+
// Save callee-saved registers
11+
stp x19, x20, [sp, #0] // Save x19 and x20
12+
stp x21, x22, [sp, #16] // Save x21 and x22
13+
stp x23, x24, [sp, #32] // Save x23 and x24
14+
stp x25, x26, [sp, #48] // Save x25 and x26
15+
stp x27, x28, [sp, #64] // Save x27 and x28
16+
17+
// Move the method pointer (selector) into x0
18+
mov x0, x1 // Assuming the selector is passed in x1
19+
20+
// Move the receiver object pointer into x19
21+
mov x19, x2 // Assuming the receiver object pointer is passed in x2
22+
23+
// Call objc_msg_lookup() to get the IMP (method implementation pointer)
24+
bl _objc_msg_lookup
25+
26+
// Restore callee-saved registers
27+
ldp x19, x20, [sp, #0] // Restore x19 and x20
28+
ldp x21, x22, [sp, #16] // Restore x21 and x22
29+
ldp x23, x24, [sp, #32] // Restore x23 and x24
30+
ldp x25, x26, [sp, #48] // Restore x25 and x26
31+
ldp x27, x28, [sp, #64] // Restore x27 and x28
32+
33+
// Epilogue
34+
ldp x29, x30, [sp], #16 // Restore frame pointer and link register
35+
ret // Return from function

Frameworks/OpenGL/libdrm/Makefile

+10-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ PACKAGE= lib${LIB}
1616
SHLIB_MAJOR= 2
1717

1818
SRCS= ${LIBDRM_FILES} ${LIBDRM_NOUVEAU_FILES} ${LIBDRM_AMDGPU_FILES}
19-
SRCS+= ${LIBDRM_RADEON_FILES} ${LIBDRM_INTEL_FILES}
19+
SRCS+= ${LIBDRM_RADEON_FILES}
20+
21+
.if ${.TARGET} == "amd64" || ${.TARGET} == "i386"
22+
SRCS+= ${LIBDRM_INTEL_FILES}
23+
.endif
24+
2025
INCSDIR= ${INCLUDEDIR}/${PACKAGE}
2126
INCS=
2227
CFLAGS+= -I${.CURDIR}/include/drm -I${.CURDIR} \
@@ -26,7 +31,6 @@ CFLAGS+= -I${.CURDIR}/include/drm -I${.CURDIR} \
2631
-DHAVE_SYS_SYSCTL_H \
2732
-DHAVE_OPEN_MEMSTREAM \
2833
-DHAVE_VISIBILITY \
29-
-DHAVE_INTEL \
3034
-DHAVE_RADEON \
3135
-DHAVE_VMWGFX \
3236
-DHAVE_VC4 \
@@ -38,6 +42,10 @@ CFLAGS+= -I${.CURDIR}/include/drm -I${.CURDIR} \
3842
-Wno-error=gnu-variable-sized-type-not-at-end \
3943
-Wno-error=\#warnings
4044

45+
.if ${.TARGET} == "amd64" || ${.TARGET} == "i386"
46+
CFLAGS+= -DHAVE_INTEL
47+
.endif
48+
4149
LDFLAGS+= -L${MAKEOBJDIR}/../libpciaccess -lpciaccess -Wl,-R\$$ORIGIN/Resources
4250

4351
WARNS?= 2

Frameworks/OpenGL/mesa/Makefile

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ CFLAGS+= -I${.CURDIR}/../libdrm/nouveau
1414
CFLAGS+= -I${.CURDIR}/../libdrm/radeon
1515
CFLAGS+= -I${.CURDIR}/../libdrm/intel
1616
CFLAGS+= -I${.CURDIR}/../libdrm/include/drm
17+
CFLAGS+= -Wno-format -Wno-asm-operand-widths
1718

1819
LDFLAGS= -L${MAKEOBJDIR}/../wayland/src -lwayland
1920
LDFLAGS+= -L${MAKEOBJDIR}/../libdrm -ldrm
@@ -26,7 +27,7 @@ all: build
2627
build:
2728
LD_LIBRARY_PATH=${OBJTOP}/tmp/usr/lib:${OBJTOP}/Frameworks/OpenGL/libpciaccess \
2829
PYTHONPATH=${OBJTOP}/tmp/usr/lib/python3.10 \
29-
PATH=${OBJTOP}/tmp/usr/bin:${OBJTOP}/tmp/legacy/bin:${OBJTOP}/Frameworks/OpenGL/wayland/scanner:${PATH} \
30+
PATH=${OBJTOP}/tmp/usr/bin:${OBJTOP}/tmp/legacy/bin:${OBJTOP}/Frameworks/OpenGL/wayland/scanner:$${PATH} \
3031
${MESON} setup --reconfigure -Dprefix=${PREFIX} -Dplatforms=wayland \
3132
-DSRCTOP=${SRCTOP} -Dc_args="${CFLAGS}" -Dcpp_args="${CFLAGS}" \
3233
-Dc_link_args="${LDFLAGS}" -Dcpp_link_args="${LDFLAGS}" \
@@ -38,7 +39,7 @@ build:
3839
-Dgbm=enabled -Dxmlconfig=disabled -Dexpat=disabled \
3940
${MAKEOBJDIR} ${.CURDIR}
4041
sed -i.bak -e 's@-I/usr/include@@g' ${MAKEOBJDIR}/build.ninja
41-
PATH=${OBJTOP}/tmp/usr/bin:${OBJTOP}/tmp/legacy/bin:${OBJTOP}/Frameworks/OpenGL/wayland/scanner:${OBJTOP}/usr.bin/clang/llvm-ar \
42+
PATH=${OBJTOP}/tmp/usr/bin:${OBJTOP}/tmp/legacy/bin:${OBJTOP}/Frameworks/OpenGL/wayland/scanner:${OBJTOP}/usr.bin/clang/llvm-ar:$$PATH \
4243
${NINJA}
4344

4445
install:

Frameworks/OpenGL/mesa/meson.build

+3-3
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ if gallium_drivers.contains('auto')
141141
]
142142
elif ['arm', 'aarch64'].contains(host_machine.cpu_family())
143143
gallium_drivers = [
144-
'v3d', 'vc4', 'freedreno', 'etnaviv', 'nouveau', 'svga',
144+
'vc4', 'etnaviv', 'nouveau', 'svga',
145145
'tegra', 'virgl', 'lima', 'panfrost', 'swrast', 'iris'
146146
]
147147
elif ['mips', 'mips64', 'riscv32', 'riscv64'].contains(host_machine.cpu_family())
@@ -1110,8 +1110,8 @@ else
11101110

11111111
# MinGW chokes on format specifiers and I can't get it all working
11121112
if not (cc.get_argument_syntax() == 'gcc' and host_machine.system() == 'windows')
1113-
_trial_c += ['-Werror=format', '-Wformat-security']
1114-
_trial_cpp += ['-Werror=format', '-Wformat-security']
1113+
_trial_c += ['-Wformat-security']
1114+
_trial_cpp += ['-Wformat-security']
11151115
endif
11161116

11171117
# FreeBSD annotated <pthread.h> but Mesa isn't ready

Frameworks/OpenGL/mesa/src/microsoft/vulkan/meson.build

-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ if cc.get_argument_syntax() != 'msvc'
7070
'-Werror=unused-variable',
7171
'-Werror=unused-but-set-variable',
7272
'-Werror=unused-value',
73-
'-Werror=format',
7473
'-Werror=switch',
7574
]
7675
dzn_flags += cc.get_supported_arguments(dzn_flags_to_try)

lib/libpixman/Makefile

+10-5
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,19 @@ SRCS+= \
6363

6464
.if ${MACHINE} == "arm64"
6565
CFLAGS+= \
66-
-DUSE_ARM_SIMD \
67-
-DUSE_ARM_A64_NEON
66+
-UPIXMAN_TIMERS \
67+
-DUSE_ARM_SIMD
6868
SRCS+= \
69-
pixman-arm-neon.c \
7069
pixman-arm-simd.c
70+
.else
71+
CFLAGS+= \
72+
-DPIXMAN_TIMERS
7173
.endif
7274

75+
# add back later:
76+
# -DUSE_ARM_A64_NEON
77+
# pixman-arm-neon.c \
78+
7379
CFLAGS+= \
7480
-DHAVE_ALARM \
7581
-DHAVE_BUILTIN_CLZ \
@@ -95,11 +101,10 @@ CFLAGS+= \
95101
-DHAVE_LIBPNG \
96102
-DHAVE_PTHREADS \
97103
-DHAVE_FLOAT128 \
98-
-DPIXMAN_TIMERS \
99104
-DSIZEOF_LONG=8
100105

101106
WARNS?= 2
102-
CFLAGS+= -Wno-error=format -Wno-error=expansion-to-defined
107+
CFLAGS+= -Wno-error=format -Wno-error=expansion-to-defined -Wno-error=unknown-attributes
103108

104109
pixman-version.h: pixman/pixman-version.h.in
105110
sed -e "s/@PIXMAN_VERSION_MAJOR@/${MAJOR}/" \

lib/libpng/.appveyor.yml

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
version: 1.6.x-{build}
2+
3+
branches:
4+
except:
5+
- /libpng[0-1][0-7]/
6+
- /v[0-1][.][0-7][.][0-9]+/
7+
8+
image:
9+
- Visual Studio 2022
10+
11+
shallow_clone: true
12+
13+
environment:
14+
matrix:
15+
- TOOLCHAIN: vstudio
16+
AUTOMATION: cmake
17+
ARCH: x86
18+
- TOOLCHAIN: vstudio
19+
AUTOMATION: cmake
20+
ARCH: x64
21+
- TOOLCHAIN: vstudio
22+
AUTOMATION: cmake
23+
ARCH: arm64
24+
- TOOLCHAIN: llvm
25+
AUTOMATION: cmake
26+
ARCH: x64
27+
- TOOLCHAIN: msys2
28+
AUTOMATION: cmake
29+
ARCH: i686
30+
- TOOLCHAIN: msys2
31+
AUTOMATION: cmake
32+
ARCH: x86_64
33+
- TOOLCHAIN: msys2
34+
AUTOMATION: configure
35+
ARCH: i686
36+
- TOOLCHAIN: msys2
37+
AUTOMATION: configure
38+
ARCH: x86_64
39+
- TOOLCHAIN: msys2
40+
AUTOMATION: makefiles
41+
ARCH: i686
42+
- TOOLCHAIN: msys2
43+
AUTOMATION: makefiles
44+
ARCH: x86_64
45+
46+
install:
47+
- 'if "%TOOLCHAIN%"=="vstudio" C:\tools\vcpkg\vcpkg.exe install zlib:%ARCH%-windows'
48+
- 'if "%TOOLCHAIN%"=="vstudio" C:\tools\vcpkg\vcpkg.exe integrate install'
49+
- 'if "%TOOLCHAIN%"=="llvm" C:\tools\vcpkg\vcpkg.exe install zlib:%ARCH%-windows'
50+
- 'if "%TOOLCHAIN%"=="llvm" C:\tools\vcpkg\vcpkg.exe integrate install'
51+
52+
before_build:
53+
- 'if "%TOOLCHAIN%"=="vstudio" set CI_CMAKE_GENERATOR=Visual Studio 17 2022'
54+
- 'if "%TOOLCHAIN%"=="vstudio" set CI_CMAKE_TOOLCHAIN_FILE=C:\tools\vcpkg\scripts\buildsystems\vcpkg.cmake'
55+
- 'if "%TOOLCHAIN%"=="vstudio" if "%ARCH%"=="x86" set CI_CMAKE_GENERATOR_PLATFORM=Win32'
56+
- 'if "%TOOLCHAIN%"=="vstudio" if "%ARCH%"=="x64" set CI_CMAKE_GENERATOR_PLATFORM=x64'
57+
- 'if "%TOOLCHAIN%"=="vstudio" if "%ARCH%"=="arm64" set CI_CMAKE_GENERATOR_PLATFORM=ARM64'
58+
- 'if "%TOOLCHAIN%"=="vstudio" if "%ARCH%"=="arm64" set CI_CMAKE_VARS=-DPNG_TESTS=0'
59+
- 'if "%TOOLCHAIN%"=="llvm" set CI_CMAKE_GENERATOR=Ninja'
60+
- 'if "%TOOLCHAIN%"=="llvm" set CI_CMAKE_TOOLCHAIN_FILE=C:\tools\vcpkg\scripts\buildsystems\vcpkg.cmake'
61+
- 'if "%TOOLCHAIN%"=="llvm" set CI_CC=clang.exe'
62+
- 'if "%TOOLCHAIN%"=="msys2" if "%AUTOMATION%"=="cmake" set CI_CMAKE_GENERATOR=Unix Makefiles'
63+
- 'if "%TOOLCHAIN%"=="msys2" if "%ARCH%"=="i686" set PATH=C:\msys64\mingw32\bin;%PATH%'
64+
- 'if "%TOOLCHAIN%"=="msys2" if "%ARCH%"=="x86_64" set PATH=C:\msys64\mingw64\bin;%PATH%'
65+
- 'if "%TOOLCHAIN%"=="msys2" set CI_CC=%ARCH%-w64-mingw32-gcc.exe'
66+
- 'set CI_CMAKE_BUILD_FLAGS=-j2'
67+
- 'set CI_CTEST_FLAGS=-j2'
68+
- 'set CI_MAKE_FLAGS=-j2'
69+
- 'set CI_MAKEFILES=scripts/makefile.gcc scripts/makefile.msys scripts/makefile.std'
70+
71+
build_script:
72+
- 'if "%TOOLCHAIN%"=="vstudio" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_verify_cmake.sh"'
73+
- 'if "%TOOLCHAIN%"=="llvm" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_verify_cmake.sh"'
74+
- 'if "%TOOLCHAIN%"=="msys2" if "%AUTOMATION%"=="cmake" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_verify_cmake.sh"'
75+
- 'if "%TOOLCHAIN%"=="msys2" if "%AUTOMATION%"=="configure" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_verify_configure.sh"'
76+
- 'if "%TOOLCHAIN%"=="msys2" if "%AUTOMATION%"=="makefiles" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_verify_makefiles.sh"'
77+
78+
cache:
79+
- C:\tools\vcpkg\installed

lib/libpng/.editorconfig

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# https://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
insert_final_newline = true
8+
trim_trailing_whitespace = true
9+
10+
[*.txt]
11+
indent_style = space
12+
13+
[*.[chS]]
14+
indent_style = space
15+
max_doc_length = 80
16+
max_line_length = 80
17+
18+
[*.dfa]
19+
indent_style = space
20+
max_doc_length = 80
21+
max_line_length = 80
22+
23+
[*.{awk,cmake}]
24+
indent_style = space
25+
max_doc_length = 80
26+
max_line_length = 100
27+
28+
[*.{in,sh}]
29+
indent_style = space
30+
max_doc_length = 100
31+
max_line_length = 100
32+
33+
[{Makefile.in,ltmain.sh}]
34+
indent_style = unset
35+
insert_final_newline = unset
36+
max_doc_length = unset
37+
max_line_length = unset
38+
trim_trailing_whitespace = unset
39+
40+
[COMMIT_EDITMSG]
41+
indent_style = space
42+
max_doc_length = unset
43+
max_line_length = 72

lib/libpng/.github/workflows/lint.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Linting libpng
2+
3+
on:
4+
push:
5+
branches:
6+
- libpng16
7+
pull_request:
8+
branches:
9+
- libpng16
10+
11+
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 5
15+
steps:
16+
- name: Set up the cache
17+
uses: actions/cache@v4
18+
with:
19+
path: ~/.cache/pip
20+
key: ${{ runner.os }}-pip-${{ hashFiles('**/pip.txt') }}
21+
restore-keys: ${{ runner.os }}-pip-
22+
- name: Install yamllint
23+
run: pip install yamllint
24+
- name: Check out the code
25+
uses: actions/checkout@v4
26+
- name: Run the linting script
27+
run: bash ./ci/ci_lint.sh

0 commit comments

Comments
 (0)