-
-
Notifications
You must be signed in to change notification settings - Fork 10k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pkgconfig: Wrong libdir? #23569
Comments
Er no... not for the moment. I'll have a look. |
I think this is a user error, actually. Let me ask in the discussion thread |
@levitte I ran
and
|
So, we do have an issue, that it's pretty unclear what's the difference between $BLDDIR/libcrypto.pc and $BLDDIR/exporters/libcrypto.pc. I'll arrange some commentary |
fyi: same result when I omitted the |
Oh, er, you're using Lines 338 to 350 in 0969375
|
Sorry, I expressed myself confusingly. I wanted to say: the same resulting pkgconfig files are generated when I do not specify the libdir arg to configure. |
Hmmm, that's curious. I'll double check, but I'm pretty sure I don't get that |
@levitte send your machine over to me immediately! I run on |
Heh 😉 Awright, I'm getting what I expected (with /lib64 in the libdir paths). Maybe you're running into some odd path corner case I haven't encountered. I could try reproduce your circumstances, which is essentially an in-source-tree build. Do I get it right that you're observing this oddity with the following config command?
|
Still not. $ cat /opt/quic/openssl-master/lib64/pkgconfig/libcrypto.pc
libdir=/opt/quic/openssl-master/lib64
includedir=/opt/quic/openssl-master/include
enginesdir=/opt/quic/openssl-master/lib64/engines-3
modulesdir=/opt/quic/openssl-master/lib64/ossl-modules
Name: OpenSSL-libcrypto
Description: OpenSSL cryptography library
Version: 3.3.0-dev
Libs: -L${libdir} -lcrypto
Libs.private: -ldl -pthread
Cflags: -I${includedir}
$ cat /opt/quic/openssl-master/lib64/pkgconfig/libssl.pc
libdir=/opt/quic/openssl-master/lib64
includedir=/opt/quic/openssl-master/include
Name: OpenSSL-libssl
Description: Secure Sockets Layer and cryptography libraries
Version: 3.3.0-dev
Requires.private: libcrypto
Libs: -L${libdir} -lssl
Cflags: -I${includedir} The way this is done is that Makefile creates Here's how it's done in my setup: $ grep mkinstallvars Makefile
builddata.pm: util/mkinstallvars.pl
$(PERL) util/mkinstallvars.pl PREFIX=. BINDIR=apps LIBDIR= INCLUDEDIR=include APPLINKDIR=ms ENGINESDIR=engines MODULESDIR=providers "VERSION=$(VERSION)" "LDLIBS=$(LIB_EX_LIBS)" > $@
installdata.pm: util/mkinstallvars.pl
$(PERL) util/mkinstallvars.pl "PREFIX=$(INSTALLTOP)" BINDIR=bin "LIBDIR=$(LIBDIR)" INCLUDEDIR=include APPLINKDIR=include/openssl "ENGINESDIR=$(ENGINESDIR)" "MODULESDIR=$(MODULESDIR)" "PKGCONFIGDIR=$(PKGCONFIGDIR)" "CMAKECONFIGDIR=$(CMAKECONFIGDIR)" "LDLIBS=$(LIB_EX_LIBS)" "VERSION=$(VERSION)" > $@ The LIBDIR var in those command lines is the variable we're trying to figure out. In my Makefile, it looks like this: $ grep ^LIBDIR= Makefile
LIBDIR=lib64 Could you have a look to see what this looks like on your end? |
Ran:
Then
|
That's infuriating... Can you help figure this out? I'm guessing that something odd is going on in diff --git a/util/mkinstallvars.pl b/util/mkinstallvars.pl
index 59a432d28c..3ba88b5c38 100644
--- a/util/mkinstallvars.pl
+++ b/util/mkinstallvars.pl
@@ -21,6 +21,7 @@ my @subdirs = qw(BINDIR LIBDIR INCLUDEDIR APPLINKDIR ENGINESDIR MODULESDIR
my %keys = ();
foreach (@ARGV) {
+ print STDERR "[DEBUG] ARG: $_\n";
(my $k, my $v) = m|^([^=]*)=(.*)$|;
$keys{$k} = 1;
$ENV{$k} = $v;
@@ -47,8 +48,10 @@ foreach my $k (sort keys %keys) {
$ENV{"${k}_REL"} = $v;
$v = File::Spec->rel2abs($v, $ENV{PREFIX});
}
+ print STDERR "[DEBUG] \$ENV{${k}_REL} = $ENV{'${k}_REL'}\n";
}
$ENV{$k} = $v;
+ print STDERR "[DEBUG] \$ENV{$k} = $ENV{$k}\n";
}
print <<_____; And then just do this: $ rm installdata.pm
$ make exporters/libcrypto.pc Hopefully, the output will tell us something. It may turn out that this is a bug in perl's File::Spec we've encountered before, where one of rel2abs or abs2rel doesn't work quite right. Speaking of which, perl version? |
Standard macOS /usr/bin/perl:
|
Er... that looks like what I expected. Not entirely, the Last check to do, show and tell style: $ make exporters/openssl.pc
$ grep LIBDIR builddata.pm installdata.pm
builddata.pm: $LIBDIR $LIBDIR_REL
builddata.pm:our $LIBDIR = '/home/levitte/tmp/openssl-master';
builddata.pm:our $LIBDIR_REL = '.';
installdata.pm: $LIBDIR $LIBDIR_REL
installdata.pm:our $LIBDIR = '/opt/quic/openssl-master/lib64';
installdata.pm:our $LIBDIR_REL = 'lib64';
$ grep libdir exporters/*.pc
exporters/libcrypto.pc:libdir=/opt/quic/openssl-master/lib64
exporters/libcrypto.pc:Libs: -L${libdir} -lcrypto
exporters/libssl.pc:libdir=/opt/quic/openssl-master/lib64
exporters/libssl.pc:Libs: -L${libdir} -lssl
exporters/openssl.pc:libdir=/opt/quic/openssl-master/lib64 |
(note that the libdir in openssl.pc doesn't really matter) |
can I please get some clarification on this. |
FWIW: I had the same issue: the "lib" ending was missing for "libdir" in libcrypto.pc in OpenSSL 3.3 (no such issues with 3.2.1 and earlier). Turns out I was also using full path for --libdir (perhaps it should have been named --libdirname!). But unlike icing, your comment fixed the bug for me! Thanks! |
Perhaps it should be renamed, indeed. That will be a surprising build break for most, though. We've had |
Now Homebrew is delivering pkgconfig files with wrong libdirs. |
is this perhaps a duplicate of #24298 ? |
No response, marking as a duplicate of #24298 |
It wasn't, FYI. But considering we couldn't reproduce it, it was difficult to fix it. |
OpenSSL has a bug that messes the config `--libdir=path` to become the wrong path in its pkgconfig files. If we just pass `--libdir=lib` it should avoid this. See also: openssl/openssl#23569
Also mention in HTTP3.md OpenSSL has a bug that messes the config `--libdir=path` to become the wrong path in its pkgconfig files. If we just pass `--libdir=lib` it should avoid this. Ref: #14099 See also: openssl/openssl#23569 Closes #14102
@icing reported a minor issue with the pkgconfig files here: #23339 (reply in thread)
@levitte Any ideas?
The text was updated successfully, but these errors were encountered: