Opened 10 years ago

Closed 2 years ago

#46701 closed defect (fixed)

kerberos5 does not build on PPC Tiger, Mac OS X 10.4.11, because void value cannot be ignored as it ought to be

Reported by: ballapete (Peter "Pete" Dyballa) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.3.3
Keywords: tiger powerpc Cc: geoffd2
Port: kerberos5

Description

/usr/bin/gcc-4.0 -DHAVE_CONFIG_H -DGET_TGT_VIA_PASSWD -DPRINC_LOOK_AHEAD -DCMD_PATH='"/bin /local/bin"' -I../../include -I../../include  -DKRB5_DEPRECATED=1 -DKRB5_PRIVATE -I/opt/local/include -pipe -Os -arch ppc -fno-common -Wall -Wcast-align -Wshadow -Wmissing-prototypes -Wno-format-zero-length -Wmissing-format-attribute -Wmissing-prototypes -Wreturn-type -Wmissing-braces -Wparentheses -Wswitch -Wunused-function -Wunused-label -Wunused-variable -Wunused-value -Wunknown-pragmas -Wsign-compare -Wnewline-eof -Wdeclaration-after-statement -Werror-implicit-function-declaration  -c main.c
main.c: In function ‘get_configured_defccname’:
main.c:818: error: void value not ignored as it ought to be
make[2]: *** [main.o] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_net_kerberos5/kerberos5/work/krb5-1.13-final/src/clients/ksu'

Attachments (3)

main.log (667.1 KB) - added by ballapete (Peter "Pete" Dyballa) 10 years ago.
main.log
patch-void_unsetenv_PPC_Tiger.diff (602 bytes) - added by ballapete (Peter "Pete" Dyballa) 10 years ago.
Proposed patch for (PPC) Tiger/Mac OS X 10.4.11
void_unsetenv_PPC_Tiger.patch (533 bytes) - added by miniupnp (Thomas BERNARD) 9 years ago.
patch to check if unsetenv() succeded using getenv()

Download all attachments as: .zip

Change History (22)

Changed 10 years ago by ballapete (Peter "Pete" Dyballa)

Attachment: main.log added

main.log

comment:1 Changed 10 years ago by ballapete (Peter "Pete" Dyballa)

I think I have found the cause for the failure – it's not easy to understand what GCC 4.2 reports! On (PPC) Tiger unsetenv() is a void, but the return value of unsetenv() is compared with zero, which has to fail. Changing that block

-    if (unsetenv(KRB5_ENV_CCNAME) != 0) {
-        retval = errno;
-        com_err(prog_name, retval, _("while clearing the value of %s"),
-                KRB5_ENV_CCNAME);
-        return retval;
-    }

to simple

+    /* On PPC Tiger unsetenv is a void(), nothing to compare. */
+    unsetenv(KRB5_ENV_CCNAME);

seems to be equivalent and to fix the issue. This is a rather crude fix, because I have no idea which #defines for the Darwin/Mac OS X version exist.

Changed 10 years ago by ballapete (Peter "Pete" Dyballa)

Proposed patch for (PPC) Tiger/Mac OS X 10.4.11

comment:2 Changed 10 years ago by mf2k (Frank Schima)

Keywords: tiger powerpc added

comment:3 Changed 10 years ago by geoffd2

Same failure here with gcc-4.0 (which I think is what you are using, not apple-gcc42). (Different bug with 4.2 see #47006) I'll try your patch.

Last edited 9 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:4 in reply to:  3 ; Changed 9 years ago by ballapete (Peter "Pete" Dyballa)

Replying to geoffdown@…:

Same failure here with gcc-4.0 (which I think is what you are using, not apple-gcc42).

Yes, you are correct!

I'll try your patch.

Did it work for you?

comment:5 in reply to:  4 ; Changed 9 years ago by geoffd2

Replying to Peter_Dyballa@…:

Replying to geoffdown@…:

Same failure here with gcc-4.0 (which I think is what you are using, not apple-gcc42).

Yes, you are correct!

I'll try your patch.

Did it work for you?

Yes - but I see the new version @1.13.2_0 has the same problem. Are the maintainers not listening?

comment:6 Changed 9 years ago by geoffd2

Cc: geoffdown@… added
Last edited 9 years ago by geoffd2 (previous) (diff)

comment:7 Changed 9 years ago by geoffd2

The patch works for the new version as well - at least as far as allowing installation to complete. Whether there is any functional downside I am unqualified to judge.

comment:8 in reply to:  7 ; Changed 9 years ago by ballapete (Peter "Pete" Dyballa)

Replying to geoffdown@…:

The patch works for the new version as well - at least as far as allowing installation to complete. Whether there is any functional downside I am unqualified to judge.

The original six lines try to check whether the invocation of unsetenv(KRB5_ENV_CCNAME) returns an error, and if so that the error happened while clearing the environment variable KRB5_ENV_CCNAME. Since on Tiger unsetenv() is a void function, i.e. it does not return a return value, it's not possible to check success this simple way. A real substitute of the original six lines would try to read the environment after clearing and report then that clearing failed.

comment:9 in reply to:  5 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to geoffdown@…:

Are the maintainers not listening?

I only just became the maintainer 3 days ago in r136339. Prior to that, the port has not had a maintainer since Yves gave it up in 2007 in r21217.

I'm trying to assess what to do with all the open tickets. If you believe the patch provided here is correct, please file a ticket with the developers of kerberos5 and provide the patch to them so they can include it in the next version, and please note here the URL of the ticket.

comment:10 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: changed from macports-tickets@… to ryandesign@…
Status: newassigned

comment:11 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

The R project fixed a similar problem in their software back in 2007 with this patch:

Index: src/main/sysutils.c
===================================================================
--- src/main/sysutils.c	(revision 40400)
+++ src/main/sysutils.c	(revision 40401)
@@ -26,6 +26,10 @@
 #include <config.h>
 #endif
 
+#if defined(__APPLE__) && ( ! defined(_POSIX_C_SOURCE) || (_POSIX_C_SOURCE < 200112L) )
+#define _POSIX_C_SOURCE 200112L /* for correct unsetenv */
+#endif
+
 #include <stdlib.h> /* for putenv */
 #include <Defn.h>
 #include <R_ext/Riconv.h>

That's part of revision r40401 in their repository at https://svn.r-project.org/R/. See https://stat.ethz.ch/pipermail/r-devel/2007-January/044228.html. Perhaps something similar would help kerberos5.

Last edited 9 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:12 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Has duplicate #48845.

Changed 9 years ago by miniupnp (Thomas BERNARD)

patch to check if unsetenv() succeded using getenv()

comment:13 in reply to:  8 Changed 9 years ago by miniupnp (Thomas BERNARD)

Replying to Peter_Dyballa@…:

Replying to geoffdown@…:

The patch works for the new version as well - at least as far as allowing installation to complete. Whether there is any functional downside I am unqualified to judge.

The original six lines try to check whether the invocation of unsetenv(KRB5_ENV_CCNAME) returns an error, and if so that the error happened while clearing the environment variable KRB5_ENV_CCNAME. Since on Tiger unsetenv() is a void function, i.e. it does not return a return value, it's not possible to check success this simple way. A real substitute of the original six lines would try to read the environment after clearing and report then that clearing failed.

It is what I've done with my patch : unsetenv() then check with getenv()

comment:14 Changed 9 years ago by miniupnp (Thomas BERNARD)

From the linux man page : Prior to glibc 2.2.2, unsetenv() was prototyped as returning void; more recent glibc versions follow the POSIX.1-2001-compliant prototype shown in the SYNOPSIS.

comment:15 Changed 9 years ago by miniupnp (Thomas BERNARD)

comment:16 in reply to:  15 Changed 9 years ago by ballapete (Peter "Pete" Dyballa)

Replying to thomas@…:

it has been fixed upstream : https://github.com/krb5/krb5/commit/7eee546db10e907666e02fdded4f512e8d0faf4c

kerberos5 @1.13.2_2 still uses krb5-1.13.2-final.tar.gz and needs that patch.

It seems, last updated on Thursday evening UTC, yesterday, does not provide any of the two patches for Tiger. Thomas' patch needs a patch: the paths to the files may not start with "src/". This path element needs to be removed. With this corrected patch kerberos5 @1.13.2_2 builds fine on PPC Tiger, Mac OS X 10.4.11.

comment:17 Changed 8 years ago by rickyzhang82 (Ricky Zhang)

Hi Gentelmen above,

I experienced compile issue for kerberos5 in Tiger. But with different errors.

It set 0.0 to dynamic library major and minor version. gcc isn't happy with this. gcc has no documents whatsoever to describe their gazillion number of parameter. I got stuck to compile this dependency for installing git.

Any new update?

comment:18 Changed 2 years ago by ballapete (Peter "Pete" Dyballa)

Kerberos5 is now @1.20.1, installed, and working. So this ticket can be closed IMO.

comment:19 Changed 2 years ago by kencu (Ken)

Resolution: fixed
Status: assignedclosed

Thanks!

Note: See TracTickets for help on using tickets.