The Makefile has CURL_CONFIG=curl-config which outputs the native system's build settings for curl. This causes cross-compilation with curl support to fail if the target system's curl has a different configuration. The problem is made more apparent since bug #736744 where http2 is enabled by default, because http2 is masked for riscv, so Git cannot be cross-compiled for riscv anymore without profile modifications. Reproducible: Always Steps to Reproduce: 1. cross-emerge -v dev-vcs/git Actual Results: riscv64-gentoo-linux-gnu-gcc -O2 -pipe -ggdb -flto=jobserver -Wall -I. -DHAVE_SYSINFO -DGIT_HOST_CPU="\"x86_64\"" -DUSE_LIBPCRE1 -DNO_LIBPCRE1_JIT -DHAVE_ALLOCA_H -DUSE_CURL_FOR_IMAP_SEND -DSHA1_BLK -DSHA256_BLK -DHAVE_PATHS_H -DHAVE_DEV_TTY -DHAVE_CLOCK_GETTIME -DHAVE_CLOCK_MONOTONIC -DHAVE_GETDELIM '-DPROCFS_EXECUTABLE_PATH="/proc/self/exe"' -DFREAD_READS_DIRECTORIES -DNO_STRLCPY -DSHELL_PATH='"/bin/sh"' -DPAGER_ENV='"LESS=FRX LV=-c"' -o git-http-push -Wl,-O1 -Wl,--as-needed http.o http-push.o common-main.o \ -lcurl -lnghttp2 -lssl -lcrypto -lssl -lcrypto -lz -lexpat libgit.a xdiff/lib.a -lpcre -lz -lpthread -lrt /usr/libexec/gcc/riscv64-gentoo-linux-gnu/ld: cannot find -lnghttp2 Expected Results: It should build and install. Since the curl-config program is a shell script, the cross-compiled version can be executed. A workaround is to put this in the environment: EXTRA_EMAKE=CURL_CONFIG=$SYSROOT/usr/bin/curl-config
Ech, I was literally talking to curl upstream just this week about how *-config scripts like curl-config are nasty and they basically agreed. I wonder whether git upstream would take a patch to use pkg-config instead. You could actually override CURL_CFLAGS and CURL_LDFLAGS with values from pkg-config when calling make but it still does a version check as well and there's no override mechanism for that.
(In reply to David Michael from comment #0) > Since the curl-config program is a shell script, the cross-compiled version > can be executed. A workaround is to put this in the environment: > > EXTRA_EMAKE=CURL_CONFIG=$SYSROOT/usr/bin/curl-config This would probably be good enough but it should be ESYSROOT, not SYSROOT.
I would also be content with keywording and unmasking http2 for riscv as I suggested in #gentoo-riscv yesterday (which was ignored) to make the problem invisible again, since apparently no one is hitting this issue in other contexts.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d61c9c9f6b72046e7abecdb6634b53511214919c commit d61c9c9f6b72046e7abecdb6634b53511214919c Author: Yixun Lan <dlan@gentoo.org> AuthorDate: 2020-09-01 09:41:22 +0000 Commit: Yixun Lan <dlan@gentoo.org> CommitDate: 2020-09-01 09:50:29 +0000 profiles/arch/riscv: unmask USE=http2 for net-misc/curl Bug: https://bugs.gentoo.org/738218 Signed-off-by: Yixun Lan <dlan@gentoo.org> profiles/arch/riscv/package.use.mask | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)