Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 738218 - dev-vcs/git: cross-compiling uses the native curl's configuration
Summary: dev-vcs/git: cross-compiling uses the native curl's configuration
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-20 14:54 UTC by David Michael
Modified: 2020-09-01 09:50 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Michael 2020-08-20 14:54:32 UTC
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
Comment 1 James Le Cuirot gentoo-dev 2020-08-20 15:11:00 UTC
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.
Comment 2 James Le Cuirot gentoo-dev 2020-08-20 15:12:29 UTC
(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.
Comment 3 David Michael 2020-08-20 15:19:26 UTC
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.
Comment 4 Larry the Git Cow gentoo-dev 2020-09-01 09:50:54 UTC
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(-)