Bug 53706 - program_invocation_short_name detection broken on OpenBSD
Summary: program_invocation_short_name detection broken on OpenBSD
Status: RESOLVED FIXED
Alias: None
Product: p11-glue
Classification: Unclassified
Component: p11-kit (show other bugs)
Version: unspecified
Hardware: All OpenBSD
: medium major
Assignee: Stef Walter
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-19 11:07 UTC by Antoine Jacoutot
Modified: 2012-08-23 12:39 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
use AC_LANG_PROGRAM to detect program_invocation_short_name functionnality (978 bytes, patch)
2012-08-19 11:07 UTC, Antoine Jacoutot
Details | Splinter Review
use AC_LANG_PROGRAM to detect program_invocation_short_name functionnality (v2) (1.01 KB, patch)
2012-08-21 09:16 UTC, Antoine Jacoutot
Details | Splinter Review
remove bogus comma (571 bytes, patch)
2012-08-22 07:00 UTC, Antoine Jacoutot
Details | Splinter Review

Description Antoine Jacoutot 2012-08-19 11:07:02 UTC
Created attachment 65767 [details] [review]
use AC_LANG_PROGRAM to detect program_invocation_short_name functionnality

Hi.

I'm not very good at autotools but it seems there is an issue with the
program_invocation_short_name detection.
On OpenBSD, we don't have this but for some reason,
HAVE_PROGRAM_INVOCATION_SHORT_NAME gets defined to 1 in config.h.
It looks AC_LANG_SOURCE versus AC_LANG_PROGRAM related.

I checked what GNUTls is doing for program_invocation_short_name and
they use AC_LANG_PROGRAM in the same way as the attached patch.
I can try and provide more debug output if needed, but for now
AC_LANG_PROGRAM seems to do the trick for me (I'm not saying this is the _correct_ solution; I don't know :-)).

Thoughts?
Comment 1 Antoine Jacoutot 2012-08-21 09:16:28 UTC
Created attachment 65869 [details] [review]
use AC_LANG_PROGRAM to detect program_invocation_short_name functionnality (v2)

Here's actually a better patch, fully synced to what gnutls uses.
Comment 2 Stef Walter 2012-08-21 10:19:14 UTC
What does the build failure (before applying this patch) look like?
Comment 3 Antoine Jacoutot 2012-08-21 10:23:22 UTC
(In reply to comment #2)
> What does the build failure (before applying this patch) look like?

Hi Stef.

Failure was this:

libtool: link: cc -o .libs/p11-kit -O2 -pipe -g -Wall -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wdeclaration-after-statement -Wformat=2 -Winit-self
+-Waggregate-return -Wno-missing-format-attribute -Wmissing-include-dirs -Wundef compat.o p11-kit.o -L.libs -lp11-kit -lpthread -Wl,-rpath-link,/usr/local/lib
.libs/libp11-kit.so.0.0: warning: sprintf() is often misused, please use snprintf()
compat.o(.text+0x2): In function `getprogname':
../common/compat.c:56: undefined reference to `program_invocation_short_name'
collect2: ld returned 1 exit status
Comment 4 Stef Walter 2012-08-21 10:34:34 UTC
Thanks. Merged into git master. This will be part of p11-kit 0.14

Please build and run 'make check' for p11-kit git master and make sure I applied this patch correctly. Do you have the ability test this on more than just OpenBSD?
Comment 5 Antoine Jacoutot 2012-08-21 14:52:41 UTC
(In reply to comment #4)
> Thanks. Merged into git master. This will be part of p11-kit 0.14
> 
> Please build and run 'make check' for p11-kit git master and make sure I
> applied this patch correctly. Do you have the ability test this on more than
> just OpenBSD?

Maybe I am not looking in the correct place, but I don't see anything pushed since 2012-07-31 Fix build on solaris...

I will also run make check on my Arch Linux box.
Comment 6 Stef Walter 2012-08-21 16:06:59 UTC
I(In reply to comment #5)
> (In reply to comment #4)
> > Thanks. Merged into git master. This will be part of p11-kit 0.14
> > 
> > Please build and run 'make check' for p11-kit git master and make sure I
> > applied this patch correctly. Do you have the ability test this on more than
> > just OpenBSD?
> 
> Maybe I am not looking in the correct place, but I don't see anything pushed
> since 2012-07-31 Fix build on solaris...

Indeed. The push had failed. It's there now.
Comment 7 Antoine Jacoutot 2012-08-22 07:00:33 UTC
Hi Stef.

There is a small typo in configure.ac (my fault, very sorry about that) which I couldn't see on OpenBSD but now see on Linux.
Note that it doesn't change the test result, just the configure output:
configure: line 14789: ,: command not found

Patch attached.

"make check" on Arch Linux is happy :)
Comment 8 Antoine Jacoutot 2012-08-22 07:00:57 UTC
Created attachment 65933 [details] [review]
remove bogus comma
Comment 9 Stef Walter 2012-08-23 12:10:24 UTC
Comment on attachment 65933 [details] [review]
remove bogus comma

Pushed with some other minor whitespace fixes.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.