Opened 5 years ago

Closed 17 months ago

#58591 closed defect (fixed)

check @0.10.0 does not build on PPC Tiger, MacOSX 10.4.11, because of native void function unsetenv()

Reported by: ballapete (Peter "Pete" Dyballa) Owned by: kencu (Ken)
Priority: Normal Milestone:
Component: ports Version: 2.5.4
Keywords: tiger Cc:
Port: check

Description

/opt/local/bin/gcc-apple-4.2 -DHAVE_CONFIG_H -I. -I..  -I../src -I../src -I/opt/local/include  -pipe -Os -arch ppc -Wextra -Wstrict-prototypes -Wmissing-prototypes -W\
write-strings -Wno-variadic-macros -Wimport -Wfatal-errors -Wformat=2 -Winit-self -Wmissing-include-dirs -Wswitch-default -Wunknown-pragmas -MT check_check_export-che\
ck_check_log.o -MD -MP -MF .deps/check_check_export-check_check_log.Tpo -c -o check_check_export-check_check_log.o `test -f 'check_check_log.c' || echo './'`check_che\
ck_log.c
check_check_log.c: In function 'restore_env':
check_check_log.c:24: error: void value not ignored as it ought to be
compilation terminated due to -Wfatal-errors.
{standard input}:5:FATAL:.abort  detected.  Assembly stopping.
make[2]: *** [check_check_export-check_check_log.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_devel_check/check/work/chec\
k-0.10.0/tests'

The source code is:

    9   #if HAVE_DECL_SETENV
   10   /* save environment variable's value and set new value */
   11   static int save_set_env(const char *name, const char *value,
   12                           const char **old_value)
   13   {
   14     *old_value = getenv(name);
   15     return setenv(name, value, 1);
   16   }
   17
   18   /* restore environment variable's old value, handle cases where
   19      variable must be unset (old value is NULL) */
   20   static int restore_env(const char *name, const char *old_value)
   21   {
   22     int res;
   23     if (old_value == NULL) {
   24        res = unsetenv(name);
   25     } else {
   26        res = setenv(name, old_value, 1);
   27     }
   28     return res;
   29   }
   30   #endif /* HAVE_DECL_SETENV */

Attachments (2)

main.log (74.0 KB) - added by ballapete (Peter "Pete" Dyballa) 5 years ago.
Main.log from PPC Tiger
test-suite.log (176.0 KB) - added by ballapete (Peter "Pete" Dyballa) 4 years ago.
Test-suite.log fom PPC Tiger, Mac OS X 10.4.11

Download all attachments as: .zip

Change History (9)

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

Attachment: main.log added

Main.log from PPC Tiger

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

Check builds by adding the two lines

PortGroup        legacysupport 1.0
configure.cppflags-append -D__DARWIN_UNIX03

to Portfile.

comment:2 Changed 4 years ago by cardi (calvin ardi)

I just updated check from 0.10.0 to 0.15.2: https://github.com/macports/macports-ports/commit/f9561335977f7089d98e5423bc7113f0e1872dd7

If you can verify that check 0.15.2 builds on your setup with your fixes, I'll update the Portfile with your changes and submit another pull request.

comment:3 Changed 4 years ago by kencu (Ken)

for this unsetenv error, the only thing needed is:

configure.cppflags-append -D__DARWIN_UNIX03

legacy-support may or may not be needed; that's a separate issue from this.

comment:4 Changed 4 years ago by kencu (Ken)

legacysupport is not needed; just the define. wrap it in a darwin 8 block, and we're good to go.

platform darwin 8 {
    configure.cppflags-append -D__DARWIN_UNIX03
}

comment:5 Changed 4 years ago by ballapete (Peter "Pete" Dyballa)

Using the original Portfile building check @0.15.2 ends with a failure:

make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_devel_check/check/work/libcheck-check-11970a7/tests'
/opt/local/bin/gcc-apple-4.2 -DHAVE_CONFIG_H -I. -I..  -I../src -I../src -I/opt/local/include  -pipe -Os -arch ppc -Wextra -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -Wno-variadic-macros -Wimport -Wfatal-errors -Wformat=2 -Winit-self -Wmissing-include-dirs -Wswitch-default -Wunknown-pragmas -MT check_check_export-check_check_sub.o -MD -MP -MF .deps/check_check_export-check_check_sub.Tpo -c -o check_check_export-check_check_sub.o `test -f 'check_check_sub.c' || echo './'`check_check_sub.c
check_check_sub.c: In function 'test_fail_unless_fn':
check_check_sub.c:65: warning: too many arguments for format
check_check_sub.c: In function 'test_fail_if_pass_fn':
check_check_sub.c:73: warning: too many arguments for format
check_check_sub.c:74: warning: too many arguments for format
check_check_sub.c: In function 'test_fail_if_fail_fn':
check_check_sub.c:83: warning: too many arguments for format
check_check_sub.c: In function 'test_fail_null_msg_fn':
check_check_sub.c:92: warning: too many arguments for format
check_check_sub.c: In function 'test_fail_no_msg_fn':
check_check_sub.c:103: warning: too many arguments for format
check_check_sub.c: In function 'test_fail_if_null_msg_fn':
check_check_sub.c:112: warning: too many arguments for format
check_check_sub.c: In function 'test_fail_if_no_msg_fn':
check_check_sub.c:123: warning: too many arguments for format
check_check_sub.c: In function 'test_fail_vararg_msg_1_fn':
check_check_sub.c:135: warning: too many arguments for format
check_check_sub.c: In function 'test_fail_vararg_msg_2_fn':
check_check_sub.c:147: warning: too many arguments for format
check_check_sub.c: In function 'test_fail_vararg_msg_3_fn':
check_check_sub.c:159: warning: too many arguments for format
check_check_sub.c: In function 'test_fail_empty_fn':
check_check_sub.c:171: warning: too many arguments for format
mv -f .deps/check_check_export-check_check_sub.Tpo .deps/check_check_export-check_check_sub.Po
/opt/local/bin/gcc-apple-4.2 -DHAVE_CONFIG_H -I. -I..  -I../src -I../src -I/opt/local/include  -pipe -Os -arch ppc -Wextra -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -Wno-variadic-macros -Wimport -Wfatal-errors -Wformat=2 -Winit-self -Wmissing-include-dirs -Wswitch-default -Wunknown-pragmas -MT check_check_export-check_check_master.o -MD -MP -MF .deps/check_check_export-check_check_master.Tpo -c -o check_check_export-check_check_master.o `test -f 'check_check_master.c' || echo './'`check_check_master.c
mv -f .deps/check_check_export-check_check_master.Tpo .deps/check_check_export-check_check_master.Po
/opt/local/bin/gcc-apple-4.2 -DHAVE_CONFIG_H -I. -I..  -I../src -I../src -I/opt/local/include  -pipe -Os -arch ppc -Wextra -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -Wno-variadic-macros -Wimport -Wfatal-errors -Wformat=2 -Winit-self -Wmissing-include-dirs -Wswitch-default -Wunknown-pragmas -MT check_check_export-check_check_log.o -MD -MP -MF .deps/check_check_export-check_check_log.Tpo -c -o check_check_export-check_check_log.o `test -f 'check_check_log.c' || echo './'`check_check_log.c
check_check_log.c: In function 'restore_env':
check_check_log.c:44: error: void value not ignored as it ought to be
compilation terminated due to -Wfatal-errors.
{standard input}:5:FATAL:.abort  detected.  Assembly stopping.
make[2]: *** [check_check_export-check_check_log.o] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_devel_check/check/work/libcheck-check-11970a7/tests'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_devel_check/check/work/libcheck-check-11970a7'
make: *** [all] Error 2
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_devel_check/check/work/libcheck-check-11970a7'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_devel_check/check/work/check-0.15.2" && /usr/bin/make -w all 

So it's still the same error.

comment:6 Changed 4 years ago by ballapete (Peter "Pete" Dyballa)

With Ken's proposal check builds, a make check shows some errors:

============================================================================
Testsuite summary for Check 0.15.2
============================================================================
# TOTAL: 9
# PASS:  7
# SKIP:  0
# XFAIL: 0
# FAIL:  2
# XPASS: 0
# ERROR: 0
============================================================================
See tests/test-suite.log
Please report to check-devel at lists dot sourceforge dot net
============================================================================

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

Attachment: test-suite.log added

Test-suite.log fom PPC Tiger, Mac OS X 10.4.11

comment:7 Changed 17 months ago by kencu (Ken)

Owner: set to kencu
Resolution: fixed
Status: newclosed

In bc6c3bd1ec9e323062630a3fc90623fca59648a3/macports-ports (master):

check: fix build on Tiger

closes: #58591

Note: See TracTickets for help on using tickets.