Skip to content
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

(supported versions of) AIX canot build (miniperl) since, roughly 01-Dec-2014 because of problems around assert.h #14448

Closed
p5pRT opened this issue Jan 27, 2015 · 9 comments
Labels
Closable? We might be able to close this ticket, but we need to check with the reporter distro-aix miniperl miniperl, minitest and similar 'make' targets

Comments

@p5pRT
Copy link

p5pRT commented Jan 27, 2015

Migrated from rt.perl.org#123682 (status was 'open')

Searchable as RT123682$

@p5pRT
Copy link
Author

p5pRT commented Jan 27, 2015

From @aixtools

I apologize for not having filed a bug-report THEN. Instead I had only
posted on php. And for the verbosity here now!

There was an discussion on php, I received a patch, sent some background
info about what I found - where it worked, where it did not work, etc.

The versions of AIX affected (AIX 6.1 TL8 and AIX 7.1 TL2 and later) are
the only versions officially in support.
What changed? There is a new version of assert.h that does not like a
change made in late November, early December. Effect is that all new
versions of AIX cannot compile perl (e.g., the pending "stable" release of
5.20.2).

The diff between the version of assert.h that works currently, and the new
version that fails

First the two new versions have minor (AIX version related) text
differences.

michael@​x071​:[/home/michael]diff -u x11[57]_assert.h

Inline Patch
--- x115_assert.h       2015-01-27 09:42:21 +0000
+++ x117_assert.h       2015-01-27 09:42:09 +0000
@@ -1,7 +1,7 @@
 /* IBM_PROLOG_BEGIN_TAG
*/ /\* This is an automatically generated prolog\. \*/ /\* \*/ \-/\* bos61V src/bos/usr/include/assert\.h 1\.17\.1\.2 \*/ \+/\* bos71H src/bos/usr/include/assert\.h 1\.17\.1\.2 \*/ /\* \*/ /\* Licensed Materials \- Property of IBM \*/ /\* \*/ @​@​ \-12\,7 \+12\,7 @​@​ /\* disclosure restricted by GSA ADP Schedule Contract with IBM Corp\. \*/ /\* \*/ /\* IBM\_PROLOG\_END\_TAG \*/ \-/\* @​\(\#\)34 1\.17\.1\.2 src/bos/usr/include/assert\.h\, sysdb\, bos61V\, 1211A\_61V 2/27/12 12​:40​:05 \*/ \+/\* @​\(\#\)34 1\.17\.1\.2 src/bos/usr/include/assert\.h\, sysdb\, bos71H\, 1211A\_71H 2/27/12 12​:40​:05 \*/

/*
  * COMPONENT_NAME​: (SYSDB) Kernel Debugger

+++++++++++
So, the real difference is the difference between, e.g., AIX 7.1 TL1 and
AIX 7.1 TL2
+++++++++++

michael@​x071​:[/home/michael]diff -u x11[67]_assert.h

Inline Patch
--- x116_assert.h       2015-01-27 09:42:00 +0000
+++ x117_assert.h       2015-01-27 09:42:09 +0000
@@ -1,7 +1,7 @@
 /* IBM_PROLOG_BEGIN_TAG
*/ /\* This is an automatically generated prolog\. \*/ /\* \*/ \-/\* bos610 src/bos/usr/include/assert\.h 1\.17 \*/ \+/\* bos71H src/bos/usr/include/assert\.h 1\.17\.1\.2 \*/ /\* \*/ /\* Licensed Materials \- Property of IBM \*/ /\* \*/ @​@​ \-11\,8 \+11\,8 @​@​ /\* US Government Users Restricted Rights \- Use\, duplication or \*/ /\* disclosure restricted by GSA ADP Schedule Contract with IBM Corp\. \*/ /\* \*/ \-/\* @​\(\#\)34 1\.17 src/bos/usr/include/assert\.h\, sysdb\, bos610 2/9/06 10​:52​:11 \*/ /\* IBM\_PROLOG\_END\_TAG \*/ \+/\* @​\(\#\)34 1\.17\.1\.2 src/bos/usr/include/assert\.h\, sysdb\, bos71H\, 1211A\_71H 2/27/12 12​:40​:05 \*/

/*
  * COMPONENT_NAME​: (SYSDB) Kernel Debugger
@​@​ -92,3 +92,9 @​@​

#endif /* __ASSERT_C99 */
#endif /* NDEBUG */
+
+/*ISO C standard from 2011 onward*/
+#if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201000L)) ||
defined(_ALL_SOURCE)
+#undef static_assert
+#define static_assert _Static_assert
+#endif

In short, static_assert is "Static_assert" on later versions - and this
collides.

++++
So yes, the patch - attached here - again - fixed it enough that I could
continue with blead.

What happens now?

=========
michael@​x071​:[/data/perl]rsync -az perl5.git.perl.org​::perl-current perl
-current
michael@​x071​:[/data/perl]cd -
/data/perl/smoke
michael@​x071​:[/data/perl/smoke]./runsmoke.pl -c
one
[./runsmoke.pl] chdir(/data/perl/perl-current)
Setup alarm​: Wed Jan 28 03​:04​:22 2015
Reading build configurations from /data/perl/smoke/one.cfg
Reading 'Policy.sh' from default content(1)
make distclean ...Smoking patch 8b08c4b
v5.21.8-74-g8b08c4b
Smoking branch blead

Configuration​: -Dusedevel -DDEBUGGING


make distclean ...
Copy Policy.sh ...
Configure .../opt/bin/comm​: file 2 is not in sorted order
/opt/bin/comm​: file 2 is not in sorted order
/opt/bin/comm​: file 2 is not in sorted order

make ..."pp_sys.c", line 3134.22​: 1506-280 (W) Function argument assignment
between types "char*" and "const char*" is not allowed.
ld​: 0711-317 ERROR​: Undefined symbol​: ._Static_assert
ld​: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
information.
make​: *** [lib/buildcustomize.pl] Error 8
Unable to make perl in this configuration
Finished smoking 8b08c4b
v5.21.8-74-g8b08c4b blead

===
Important excerpt #1​:
Lukas Mai <plokinom@​gmail.com>
12/1/14

to perl5-porters, me
Am 01.12.2014 um 12​:48 schrieb Jarkko Hietaniemi​:

On Monday-201412-01, 3​:19, Michael Felt wrote​:

I say particularly the IBM compiler, because the gcc compiler I have
installed is getting further.

This is issue #1​: in the smoker .log file I find several instances of​:

Guessing

http​://perl5.git.perl.org/perl.git/commit/6d59e610a3f269be73ffea56a90d1cd7dc8bf2fd

but as how to fix it, I haven't taken a look.

ld​: 0711-317 ERROR​: Undefined symbol​: ._Static_assert

ld​: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
information.
make​: *** [lib/buildcustomize.pl <http​://buildcustomize.pl>] Error 8
make​: *** Waiting for unfinished jobs....
Unable to make perl in this configuration

Indeed, that looks like my patch.

+#if defined(static_assert) || (defined(__cplusplus) && __cplusplus >=
201103L)
+/* static_assert is a macro defined in <assert.h> in C11 or a compiler
+ builtin in C++11.
+*/
+# define STATIC_ASSERT_GLOBAL(COND) static_assert(COND, #COND)

It seems like we're somehow taking this branch, so STATIC_ASSERT turns into
a call to static_assert(), which (not being a defined function) ends up a
linker error.

So either 'static_assert' is defined as a macro, or you have a fairly
modern __cplusplus. The latter seems less likely.

... oh!

I know what's going on. "_Static_assert" is a keyword in C11. The C11
version of <assert.h> simply does "#define static_assert(a, b)
_Static_assert(a, b)". You have a (C11) <assert.h> that blindly defines
static_assert (regardless of what the compiler understands), but a C90 or
C99 compiler that doesn't know about _Static_assert.
I'd consider this a bug in your <assert.h>.

I'm not sure what the best way forward is. Googling turns up the option
"–qlanglvl=extc1x". Does your compiler support this option and does perl
build with it?

Or should I add a special check for this compiler to take the fallback
branch?

====
#2
Lukas Mai <plokinom@​gmail.com>
12/1/14

to me, Perl5
Am 01.12.2014 um 23​:48 schrieb Michael Felt​:

not using a c++, am using -qlanglvl=extc99, or something like that. it
is a default I use to save me from // comments for projects that are
supposed to be c89/c99 standard compatible.
c11 is that short for c2011? in that case my compiler is too old, it saw
daylight in 2010 I believe.
I would expect the current version -13 - if I have it right, while mine
is version 11, ( so not c11).

until something changes miniperl is not going to build. although I do
need to look at my config for aix 5.3, as that is taking more time to
finish.

thanks for your consideration.

Yeah, looks like that feature is new in version 12​: http​://www-01.ibm
.com/support/knowledgecenter/SSGH2K_12.1.0/com.ibm.xlc121.aix.doc/getstar
t/c1xstandard.html?lang=en

I'll see if I can put a workaround in.


#3
Lukas Mai <plokinom@​gmail.com>
[image​: Attachments]12/2/14

to me, Perl5
Am 01.12.2014 um 23​:57 schrieb Lukas Mai​:

Am 01.12.2014 um 23​:48 schrieb Michael Felt​:

not using a c++, am using -qlanglvl=extc99, or something like that. it
is a default I use to save me from // comments for projects that are
supposed to be c89/c99 standard compatible.
c11 is that short for c2011? in that case my compiler is too old, it saw
daylight in 2010 I believe.
I would expect the current version -13 - if I have it right, while mine
is version 11, ( so not c11).

until something changes miniperl is not going to build. although I do
need to look at my config for aix 5.3, as that is taking more time to
finish.

thanks for your consideration.

Yeah, looks like that feature is new in version 12​:
http​://www-01.ibm.com/support/knowledgecenter/SSGH2K_12.1.0/com.ibm.xlc121.
aix.doc/getstart/c1xstandard.html?lang=en

I'll see if I can put a workaround in.

Patch attached. It shouldn't break anything, but does it fix your build
failure?
++++
And yes, the patch - attached here - again - fixed it.

excerpt #4
Michael Felt <aixtools@​gmail.com>
12/2/14

to Lukas, Perl5
extra info​: seems to be something that "came" with AIX 7.1 TL2 - and AIX
6.1 TL8 (x117 and x115)

x112.home.local​: 5300-07-10-0943
x113.home.local​: 6100-06-08-1216
x114.home.local​: 6100-07-09-1341
x115.home.local​: 6100-08-04-1341
x116.home.local​: 7100-01-06-1241
x117.home.local​: 7100-02-02-1316

x112.home.local​: -r--r--r-- 1 bin bin 2972 Jun 17 2004 /
usr/include/assert.h
x113.home.local​: -r--r--r-- 1 bin bin 3269 Jul 01 2007 /
usr/include/assert.h
x114.home.local​: -r--r--r-- 1 bin bin 3269 Jul 01 2007 /
usr/include/assert.h
x115.home.local​: -r--r--r-- 1 bin bin 3476 Mar 12 2012 /
usr/include/assert.h
x116.home.local​: -r--r--r-- 1 bin bin 3269 Sep 21 2009 /
usr/include/assert.h
x117.home.local​: -r--r--r-- 1 bin bin 3476 Mar 13 2012 /
usr/include/assert.h

michael@​x054​:[/home/michael]dsh -n x112,x113,x115-x117 head
/usr/include/assert.h
| grep assert.h | sort
x112.home.local​: /* bos530 src/bos/usr/include/assert.h
1.16 */
x113.home.local​: /* bos610 src/bos/usr/include/assert.h
1.17 */
x115.home.local​: /* bos61V src/bos/usr/include/assert.h
1.17.1.2 */
x116.home.local​: /* bos610 src/bos/usr/include/assert.h
1.17 */
x117.home.local​: /* bos71H src/bos/usr/include/assert.h
1.17.1.2 */

What I forgot is diff -u between the version 1.17 and 1.17.1.2

@p5pRT
Copy link
Author

p5pRT commented Jan 27, 2015

From @tonycoz

On Tue Jan 27 01​:48​:31 2015, aixtools@​gmail.com wrote​:

I apologize for not having filed a bug-report THEN. Instead I had only
posted on php. And for the verbosity here now!

There was an discussion on php, I received a patch, sent some
background
info about what I found - where it worked, where it did not work, etc.

Presumably you mean p5p rather than php.

Could you please link the thread (a message id is enough) and possibly attach the patch?

Tony

@p5pRT
Copy link
Author

p5pRT commented Jan 27, 2015

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Jan 28, 2015

From @steve-m-hay

On Tue Jan 27 14​:07​:59 2015, tonyc wrote​:

On Tue Jan 27 01​:48​:31 2015, aixtools@​gmail.com wrote​:

I apologize for not having filed a bug-report THEN. Instead I had
only
posted on php. And for the verbosity here now!

There was an discussion on php, I received a patch, sent some
background
info about what I found - where it worked, where it did not work,
etc.

Presumably you mean p5p rather than php.

Could you please link the thread (a message id is enough) and possibly
attach the patch?

I think this is the thread in question from what Michael has said elsewhere​:

http​://www.nntp.perl.org/group/perl.perl5.porters/2014/12/msg222858.html

@p5pRT
Copy link
Author

p5pRT commented Jan 28, 2015

From @aixtools

Yes - p5p (so just guess what I also use :)

The message above is correct - and just ot be certain here is the patch I
have been using. It permits compiliation in any case.

On Wed, Jan 28, 2015 at 2​:08 AM, Steve Hay via RT <perlbug-followup@​perl.org

wrote​:

On Tue Jan 27 14​:07​:59 2015, tonyc wrote​:

On Tue Jan 27 01​:48​:31 2015, aixtools@​gmail.com wrote​:

I apologize for not having filed a bug-report THEN. Instead I had
only
posted on php. And for the verbosity here now!

There was an discussion on php, I received a patch, sent some
background
info about what I found - where it worked, where it did not work,
etc.

Presumably you mean p5p rather than php.

Could you please link the thread (a message id is enough) and possibly
attach the patch?

I think this is the thread in question from what Michael has said
elsewhere​:

http​://www.nntp.perl.org/group/perl.perl5.porters/2014/12/msg222858.html

---
via perlbug​: queue​: perl5 status​: open
https://rt-archive.perl.org/perl5/Ticket/Display.html?id=123682

@p5pRT
Copy link
Author

p5pRT commented Jan 28, 2015

From @aixtools

0001-static_assert-workaround-for-AIX-xlc.patch
From adbb92561576ab614c79b60cc301e6ba6e7a7cb3 Mon Sep 17 00:00:00 2001
From: Lukas Mai <l.mai@web.de>
Date: Tue, 2 Dec 2014 00:05:50 +0100
Subject: [PATCH] static_assert workaround for AIX/xlc

---
 perl.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/perl.h b/perl.h
index 55918d0..0c8963f 100644
--- a/perl.h
+++ b/perl.h
@@ -3504,10 +3504,12 @@ typedef pthread_key_t	perl_key;
 /* placeholder */
 #endif
 
-#if defined(static_assert) || (defined(__cplusplus) && __cplusplus >= 201103L)
 /* static_assert is a macro defined in <assert.h> in C11 or a compiler
    builtin in C++11.
 */
+#if (defined(static_assert) || (defined(__cplusplus) && __cplusplus >= 201103L)) \
+    && (!defined(__IBMC__) || __IBMC__ >= 1210)
+    /* IBM XL C V11 does not support _Static_assert, no matter what <assert.h> says */
 #  define STATIC_ASSERT_GLOBAL(COND) static_assert(COND, #COND)
 #else
 /* We use a bit-field instead of an array because gcc accepts
-- 
2.1.3

@xenu xenu removed the Severity Low label Dec 29, 2021
@jkeenan jkeenan added the miniperl miniperl, minitest and similar 'make' targets label Jun 9, 2022
@jkeenan
Copy link
Contributor

jkeenan commented Jun 9, 2022

From @aixtools

0001-static_assert-workaround-for-AIX-xlc.patch

@aixtools (and/or anyone with access to AIX): Is this patch at all useful on the versions of perl we currently support?

@Tux, @khwilliamson.

If not, then is this ticket closable?

@jkeenan jkeenan added the Closable? We might be able to close this ticket, but we need to check with the reporter label Jun 9, 2022
@khwilliamson
Copy link
Contributor

I think we should apply the patch. It is to help certain versions of AIX, not perl versions

@tonycoz
Copy link
Contributor

tonycoz commented Jun 15, 2022

This patch, or something very similar was applied as 7ea096d on Tue Feb 3 19:31:04 2015, I think this is closable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closable? We might be able to close this ticket, but we need to check with the reporter distro-aix miniperl miniperl, minitest and similar 'make' targets
Projects
None yet
Development

No branches or pull requests

5 participants