Change in include/k5-platform.h breaks compiling krb5 1.15.1 on AIX (and more)

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Change in include/k5-platform.h breaks compiling krb5 1.15.1 on AIX (and more)

REIX, Tony
Hi,

I'm moving from krb5 1.9.4 to krb5 1.15.1 .
So, the issue may have appeared before version 1.15 .
It breaks AIX and possibly hpux .

Linker error message on AIX is:
   ld: 0711-328 ERROR: Undefined initfini symbol: krb5int_thread_support_fini
since the following code is generated, where krb5int_thread_support_fini() is static:

static int krb5int_thread_support_init(void); static void krb5int_thread_support_init__aux (void); static k5_init_t krb5int_thread_support_init__once = {
# 32 "threads.c" 3 4
{{ 0, 0, 0, 0, 0, 2, 0 }}
# 32 "threads.c"
, 0, 0, krb5int_thread_support_init__aux }; static void krb5int_thread_support_init__aux (void) { krb5int_thread_support_init__once.did_run = 1; krb5int_thread_support_init__once.er
ror = krb5int_thread_support_init(); } static int krb5int_thread_support_init(void);
static void krb5int_thread_support_fini(void);

The patch attached to this email fixes the issue on AIX.

Regards,

Cordialement,

Tony Reix

Bull - ATOS
IBM Coop Architect & Technical Leader
Office : +33 (0) 4 76 29 72 67
1 rue de Provence - 38432 Échirolles - France
www.atos.net<http://www.atos.net/>

_______________________________________________
krbdev mailing list             [hidden email]
https://mailman.mit.edu/mailman/listinfo/krbdev

krb5-1.15.1-krb5int_thread_support_fini-v2.patch (444 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE:Change in include/k5-platform.h breaks compiling krb5 1.15.1 on AIX (and more)

REIX, Tony
Previous patch contained a little mistake about path of file ./src/include/k5-platform.h
New patch attached.


Patch is:
--- ./src/include/k5-platform.h.ORIGIN    2017-08-23 11:07:08 +0200
+++ ./src/include/k5-platform.h    2017-08-23 11:16:24 +0200
@@ -354,7 +354,7 @@



-#if !defined(SHARED) && !defined(_WIN32)
+#if !defined(SHARED) && !defined(_WIN32) && !defined(USE_LINKER_FINI_OPTION)

 /*
  * In this case, we just don't care about finalization.


Cordialement,

Tony Reix

Bull - ATOS
IBM Coop Architect & Technical Leader
Office : +33 (0) 4 76 29 72 67
1 rue de Provence - 38432 Échirolles - France
www.atos.net<http://www.atos.net/>
________________________________
De : REIX, Tony
Envoyé : mercredi 23 août 2017 12:10
À : [hidden email]
Objet : Change in include/k5-platform.h breaks compiling krb5 1.15.1 on AIX (and more)

Hi,

I'm moving from krb5 1.9.4 to krb5 1.15.1 .
So, the issue may have appeared before version 1.15 .
It breaks AIX and possibly hpux .

Linker error message on AIX is:
   ld: 0711-328 ERROR: Undefined initfini symbol: krb5int_thread_support_fini
since the following code is generated, where krb5int_thread_support_fini() is static:

static int krb5int_thread_support_init(void); static void krb5int_thread_support_init__aux (void); static k5_init_t krb5int_thread_support_init__once = {
# 32 "threads.c" 3 4
{{ 0, 0, 0, 0, 0, 2, 0 }}
# 32 "threads.c"
, 0, 0, krb5int_thread_support_init__aux }; static void krb5int_thread_support_init__aux (void) { krb5int_thread_support_init__once.did_run = 1; krb5int_thread_support_init__once.er
ror = krb5int_thread_support_init(); } static int krb5int_thread_support_init(void);
static void krb5int_thread_support_fini(void);

The patch attached to this email fixes the issue on AIX.

Regards,

Cordialement,

Tony Reix

Bull - ATOS
IBM Coop Architect & Technical Leader
Office : +33 (0) 4 76 29 72 67
1 rue de Provence - 38432 Échirolles - France
www.atos.net<http://www.atos.net/>

_______________________________________________
krbdev mailing list             [hidden email]
https://mailman.mit.edu/mailman/listinfo/krbdev

krb5-1.15.1-krb5int_thread_support_fini-v2.patch (456 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Change in include/k5-platform.h breaks compiling krb5 1.15.1 on AIX (and more)

Greg Hudson
In reply to this post by REIX, Tony
On 08/23/2017 06:10 AM, REIX, Tony wrote:
> Linker error message on AIX is:
>    ld: 0711-328 ERROR: Undefined initfini symbol: krb5int_thread_support_fini
> since the following code is generated, where krb5int_thread_support_fini() is static:

I think this problem affects platforms which set
use_linker_fini_option=yes in shlib.conf but use SHOBJEXT=.o instead of
SHOBJEXT=.so, and therefore don't build the object files used in shared
libraries with -DSHARED.  The affected platforms appear to be OSF/1,
IRIX (pre-6.3 and without gcc), and of course AIX.

The offending commit is 4538146e1452e0966164119cefb0804993ce6bbb whose
goal was to disable finalizers in static libraries.  We are really only
worried about that problem for __attribute__((destructor)) finalizers,
so it should be okay to effectively revert that commit in the
USE_LINKER_FINI_OPTION case, as the proposed patch does, because the
linker options are only applied when shared libraries are built.  Rather
than add to the SHARED conditional, I prefer to reorder the clauses so
that the linker option stuff comes first, then the test for SHARED, then
the destructor attribute stuff.

I filed a PR at https://github.com/krb5/krb5/pull/693 if you would like
to test what I expect to merge.  I also put the diff up at
https://pastebin.com/LHHd6fDW (although I expect that to expire at some
point).
_______________________________________________
krbdev mailing list             [hidden email]
https://mailman.mit.edu/mailman/listinfo/krbdev
Reply | Threaded
Open this post in threaded view
|

RE:Change in include/k5-platform.h breaks compiling krb5 1.15.1 on AIX (and more)

REIX, Tony
Hummmm  The patch does not apply correctly:

+ patch -p1 -b --suffix .LHHd6fDW -s
+ 0< /opt/freeware/src/packages/SOURCES/krb5-1.15.1-LHHd6fDW.patch
1 out of 2 hunks FAILED -- saving rejects to file src/include/k5-platform.h.rej
Bad exit status from /var/opt/freeware/tmp/rpm-tmp.3088 (%prep)

Did I something wrong ?

Thx

Tony



# cat src/include/k5-platform.h.rej
***************
*** 361,376 ****
 
 
 
- #if !defined(SHARED) && !defined(_WIN32)
-
- /*
-  * In this case, we just don't care about finalization.  The code will still
-  * define the function, but we won't do anything with it.
-  */
- # define MAKE_FINI_FUNCTION(NAME)               \
-         static void NAME(void) UNUSED
-
- #elif defined(USE_LINKER_FINI_OPTION) || defined(_WIN32)
  /* If we're told the linker option will be used, it doesn't really
     matter what compiler we're using.  Do it the same way
     regardless.  */
--- 361,367 ----
 
 
 
+ #if defined(USE_LINKER_FINI_OPTION) || defined(_WIN32)
  /* If we're told the linker option will be used, it doesn't really
     matter what compiler we're using.  Do it the same way
     regardless.  */


Cordialement,

Tony Reix

Bull - ATOS
IBM Coop Architect & Technical Leader
Office : +33 (0) 4 76 29 72 67
1 rue de Provence - 38432 Échirolles - France
www.atos.net

________________________________________
De : Greg Hudson [[hidden email]]
Envoyé : jeudi 24 août 2017 00:00
À : REIX, Tony; [hidden email]
Objet : Re: Change in include/k5-platform.h breaks compiling krb5 1.15.1 on AIX (and more)

On 08/23/2017 06:10 AM, REIX, Tony wrote:
> Linker error message on AIX is:
>    ld: 0711-328 ERROR: Undefined initfini symbol: krb5int_thread_support_fini
> since the following code is generated, where krb5int_thread_support_fini() is static:

I think this problem affects platforms which set
use_linker_fini_option=yes in shlib.conf but use SHOBJEXT=.o instead of
SHOBJEXT=.so, and therefore don't build the object files used in shared
libraries with -DSHARED.  The affected platforms appear to be OSF/1,
IRIX (pre-6.3 and without gcc), and of course AIX.

The offending commit is 4538146e1452e0966164119cefb0804993ce6bbb whose
goal was to disable finalizers in static libraries.  We are really only
worried about that problem for __attribute__((destructor)) finalizers,
so it should be okay to effectively revert that commit in the
USE_LINKER_FINI_OPTION case, as the proposed patch does, because the
linker options are only applied when shared libraries are built.  Rather
than add to the SHARED conditional, I prefer to reorder the clauses so
that the linker option stuff comes first, then the test for SHARED, then
the destructor attribute stuff.

I filed a PR at https://github.com/krb5/krb5/pull/693 if you would like
to test what I expect to merge.  I also put the diff up at
https://pastebin.com/LHHd6fDW (although I expect that to expire at some
point).

_______________________________________________
krbdev mailing list             [hidden email]
https://mailman.mit.edu/mailman/listinfo/krbdev

krb5-1.15.1-LHHd6fDW.patch (4K) Download Attachment