@@ -6,7 +6,30 @@ $(package)_sha256_hash=b518d4d332231f313371fdefac59e3776f4f0823bcb23cf7c7305bfb5
6
6
$(package)_dependencies =xproto xextproto libX11 libXau
7
7
8
8
define $(package)_set_vars
9
- $(package ) _config_opts=--disable-shared
9
+ # A number of steps in the autoconfig process implicitly assume that the build
10
+ # system and the host system are the same. For example, library components
11
+ # want to build and run test programs to determine the behavior of certain
12
+ # host system elements. This is clearly impossible when crosscompiling. To
13
+ # work around these issues, the --enable-malloc0returnsnull (or
14
+ # --disable-malloc0returnsnull, depending on the host system) must be passed
15
+ # to configure.
16
+ # -- https://www.x.org/wiki/CrossCompilingXorg/
17
+ #
18
+ # Concretely, between the releases of libXext 1.3.2 and 1.3.3,
19
+ # XORG_CHECK_MALLOC_ZERO from xorg-macros was changed to use the autoconf
20
+ # cache, expecting cross-compilation environments to seed this cache as there
21
+ # is no single correct value when cross compiling (think uclibc, musl, etc.).
22
+ # You can see the actual change in commit 72fdc868b56fe2b7bdc9a69872651baeca72
23
+ # in the freedesktop/xorg-macros repo.
24
+ #
25
+ # As a result of this change, if we don't seed the cache and we don't use
26
+ # either --{en,dis}able-malloc0returnsnull, the AC_RUN_IFELSE block has no
27
+ # optional action-if-cross-compiling argument and configure prints an error
28
+ # message and exits as documented in the autoconf manual. Prior to this
29
+ # commit, the AC_RUN_IFELSE block had an action-if-cross-compiling argument
30
+ # which set the more pessimistic default value MALLOC_ZERO_RETURNS_NULL=yes.
31
+ # This is why the flag was not required prior to libXext 1.3.3.
32
+ $(package ) _config_opts=--disable-static --disable-malloc0returnsnull
10
33
endef
11
34
12
35
define $(package)_preprocess_cmds
0 commit comments