Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#64294 closed defect (fixed)

isl @0.24: Does not use -arch flags for all compilations

Reported by: barracuda156 Owned by: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: PowerPC, Leopard, ppc64, gcc Cc:
Port: isl

Description

The build fails with:

/opt/local/bin/ranlib: file: .libs/libisl.a(isl_ffs.o) has no symbols
libtool: link: ranlib .libs/libisl.a
ranlib: file: .libs/libisl.a(isl_ffs.o) has no symbols
libtool: link: ( cd ".libs" && rm -f "libisl.la" && ln -s "../libisl.la" "libisl.la" )
/bin/sh ./libtool  --tag=CC   --mode=link /usr/bin/gcc-4.2  -O1  -L/opt/local/lib -Wl,-headerpad_max_install_names -arch ppc64 -o isl_test isl_test.o libisl.la -lgmp 
/bin/sh ./libtool  --tag=CC   --mode=link /usr/bin/gcc-4.2  -O1  -L/opt/local/lib -Wl,-headerpad_max_install_names -arch ppc64 -o isl_polyhedron_sample polyhedron_sample.o libisl.la 
/bin/sh ./libtool  --tag=CC   --mode=link /usr/bin/gcc-4.2  -O1  -L/opt/local/lib -Wl,-headerpad_max_install_names -arch ppc64 -o isl_pip pip.o libisl.la -lgmp 
/bin/sh ./libtool  --tag=CC   --mode=link /usr/bin/gcc-4.2  -O1  -L/opt/local/lib -Wl,-headerpad_max_install_names -arch ppc64 -o isl_polyhedron_minimize polyhedron_minimize.o libisl.la -lgmp 
libtool: link: /usr/bin/gcc-4.2 -O1 -Wl,-headerpad_max_install_names -arch ppc64 -o .libs/isl_polyhedron_sample polyhedron_sample.o  -L/opt/local/lib ./.libs/libisl.dylib /opt/local/lib/libgmp.dylib
ld warning: in polyhedron_sample.o, file is not of required architecture
Undefined symbols:
  "_main", referenced from:
      start in crt1.10.5.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[2]: *** [isl_polyhedron_sample] Error 1
make[2]: *** Waiting for unfinished jobs....
libtool: link: /usr/bin/gcc-4.2 -O1 -Wl,-headerpad_max_install_names -arch ppc64 -o .libs/isl_polyhedron_minimize polyhedron_minimize.o  -L/opt/local/lib ./.libs/libisl.dylib /opt/local/lib/libgmp.dylib
libtool: link: /usr/bin/gcc-4.2 -O1 -Wl,-headerpad_max_install_names -arch ppc64 -o .libs/isl_pip pip.o  -L/opt/local/lib ./.libs/libisl.dylib /opt/local/lib/libgmp.dylib
libtool: link: /usr/bin/gcc-4.2 -O1 -Wl,-headerpad_max_install_names -arch ppc64 -o .libs/isl_test isl_test.o  -L/opt/local/lib ./.libs/libisl.dylib /opt/local/lib/libgmp.dylib
ld warning: in polyhedron_minimize.o, file is not of required architecture
Undefined symbols:
  "_main", referenced from:
      start in crt1.10.5.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[2]: *** [isl_polyhedron_minimize] Error 1
ld warning: in pip.o, file is not of required architecture
Undefined symbols:
  "_main", referenced from:
      start in crt1.10.5.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
ld warning: in isl_test.o, file is not of required architecture
Undefined symbols:
  "_main", referenced from:
      start in crt1.10.5.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[2]: *** [isl_pip] Error 1
make[2]: *** [isl_test] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_isl/isl/work/isl-0.24-ppc64'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_isl/isl/work/isl-0.24-ppc64'
make: *** [all] Error 2
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_isl/isl/work/isl-0.24-ppc64'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_isl/isl/work/isl-0.24-ppc64" && /usr/bin/make -j4 -w all 
Exit code: 2
Error: Failed to build isl: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_isl/isl/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there
is a bug.

Earlier version built as universal:

36-225:~ svacchanda$ port -v installed isl
The following ports are currently installed:
  isl @0.22.1_0 requested_variants='-universal' platform='darwin 9' archs='ppc' date='2021-12-22T12:17:44+0800'
  isl @0.22.1_0+universal (active) requested_variants='+universal' platform='darwin 9' archs='ppc ppc64' date='2021-12-21T10:37:51+0800'

Attachments (1)

main.log (209.2 KB) - added by barracuda156 2 years ago.

Download all attachments as: .zip

Change History (13)

Changed 2 years ago by barracuda156

Attachment: main.log added

comment:1 Changed 2 years ago by barracuda156

Another problem, if it is built and installed ppc-only, it breaks down gcc6 and gcc7 existing installations:

Could not open /opt/local/lib/libisl.22.dylib

After isl update there is no libisl.22.dylib there, it is replaced with libisl.23.dylib.

Last edited 2 years ago by barracuda156 (previous) (diff)

comment:2 in reply to:  1 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to barracuda156:

Another problem, if it is built and installed ppc-only, it breaks down gcc6 and gcc7 existing installations:

Could not open /opt/local/lib/libisl.22.dylib

After isl update there is no libisl.22.dylib there, it is replaced with libisl.23.dylib.

Of course. isl @0.22 provided libisl.22.dylib. isl 0.24 provides libisl.23.dylib. This library version change is why all the gcc ports that linked with libisl.22.dylib had their revisions increased as part of the isl @0.24 update and now need to be rebuilt.

comment:3 in reply to:  description Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: set to MarcusCalhoun-Lopez
Status: newassigned
Summary: New version of isl seems broken for ppc64isl @0.24: Does not use -arch flags for all compilations

Replying to barracuda156:

ld warning: in polyhedron_sample.o, file is not of required architecture

Yes I can see from the main.log that the gcc-4.2 invocation that created polyhedron_sample.o (and similarly for several other objects) did not use any -arch flags:

depbase=`echo polyhedron_sample.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
    /usr/bin/gcc-4.2 -DHAVE_CONFIG_H   -I. -I. -I./include -Iinclude/  -I/opt/local/include  -O1 -MT polyhedron_sample.o -MD -MP -MF $depbase.Tpo -c -o polyhedron_sample.o polyhedron_sample.c &&\
    mv -f $depbase.Tpo $depbase.Po

So I would expect any universal or non-default-arch build of isl on any OS version to fail at this point.

comment:4 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Confirmed: a standard +universal build on Lion also fails.

comment:5 Changed 2 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

There is a pull request that should (hopefully) fix this problem.
Any feedback would be appreciated.

comment:6 Changed 2 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Resolution: fixed
Status: assignedclosed

In df54063fb41a68d0b907394f5e00bf0d1c7423b3/macports-ports (master):

isl: respect MacPorts flags

Fixes #64294

comment:7 Changed 2 years ago by barracuda156

After upgrade of isl both gcc6 and gcc7 are broken:

Could not open /opt/local/lib/libisl.22.dylib: Error opening or reading file (referenced from /opt/local/libexec/gcc/ppc-apple-darwin9/6.5.0/cc1)
--->  Found 12 broken files, matching files to ports     
--->  Found 2 broken ports, determining rebuild order
You can always run 'port rev-upgrade' again to fix errors.
The following ports will be rebuilt:
 gcc6 @6.5.0+universal
 gcc7 @7.5.0+universal
Continue? [Y/n]: n
36-225:~ svacchanda$ port -v installed isl
The following ports are currently installed:
  isl @0.22.1_0 requested_variants='-universal' platform='darwin 9' archs='ppc' date='2021-12-22T12:17:44+0800'
  isl @0.22.1_0+universal requested_variants='+universal' platform='darwin 9' archs='ppc ppc64' date='2021-12-21T10:37:51+0800'
  isl @0.24_1+universal (active) requested_variants='+universal' platform='darwin 9' archs='ppc ppc64' date='2021-12-29T00:57:53+0800'

comment:8 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

The ports that linked with libisl.22.dylib need to be rebuilt as I explained in comment:2. Selfupdate and upgrade outdated. For gcc6, you need @6.5.0_7. For gcc7, you need @7.5.0_3.

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

when a library changes sufficiently that it can no longer properly support the software built against it (an ABI change), by convention it changes it’s library name version number, like isl has just done. This breaks all existing software using that library, forcing all of it to rebuild against the new library.

So this is all as expected.

Some people try making a symlink from the new version to the old. This is nutty, as it won’t work reliably.

debian and other linux distros often leave behind the old library version, so nothing needs urgent rebuilding, but then builds gradually get rebuilt against the new version of the library through natural updates. Once everything has rebuilt, they remove the old library. That works, but you can see takes lots of organization, and has it’s own many issues, so MacPorts does not generally do that unless software can’t build against the new library version.

So you can either rebuild, or hold back updating isl until you are ready to rebuild if you like. Or given you are on PPC where rebuilding gcc is a week-long project, you can steal out the old isl libs, if the are standalone, and leave those behind like debian does for a while, but there are potholes there to avoid and you must know what you are doing!!

People are proposing exactly this kind of thing for openssl in a PR right now in the PR queue, but I suspect it will not be allowed.

Last edited 2 years ago by kencu (Ken) (previous) (diff)

comment:10 in reply to:  9 Changed 2 years ago by barracuda156

Replying to kencu:

when a library changes sufficiently that it can no longer properly support the software built against it (an ABI change), by convention it changes it’s library name version number, like isl has just done. This breaks all existing software using that library, forcing all of it to rebuild against the new library.

So this is all as expected.

Some people try making a symlink from the new version to the old. This is nutty, as it won’t work reliably.

debian and other linux distros often leave behind the old library version, so nothing needs urgent rebuilding, but then builds gradually get rebuilt against the new version of the library through natural updates. Once everything has rebuilt, they remove the old library. That works, but you can see takes lots of organization, and has it’s own many issues, so MacPorts does not generally do that unless software can’t build against the new library version.

So you can either rebuild, or hold back updating isl until you are ready to rebuild if you like. Or given you are on PPC where rebuilding gcc is a week-long project, you can steal out the old isl libs, if the are standalone, and leave those behind like debian does for a while, but there are potholes there to avoid and you must know what you are doing!!

People are proposing exactly this kind of thing for openssl in a PR right now in the PR queue, but I suspect it will not be allowed.

Got it, thank you!

Gonna rebuild then, what to do. I just got SSD installed into my Quad tonight for 10.6, but 10.5.8 remains on HDD volume for a while. (I am just back to the Quad, gonna study your discussion with Iains now.)

  1. S. Since you mentioned openssl (asking here, since the ticket is closed): I have noticed you used openssl 1.1.1 in your SLPPC ports, while current version is 3.2. Was it for some specific reason or just left unupdated?

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

just never got around to updating that repo again since this summer, and as I don't have that 10.6 PPC set up any more, I probably never will.

If you are ready to take over the lead on that, please feel free to clone/fork/take the repo over, and go for it!

comment:12 in reply to:  11 Changed 2 years ago by barracuda156

Replying to kencu:

just never got around to updating that repo again since this summer, and as I don't have that 10.6 PPC set up any more, I probably never will.

If you are ready to take over the lead on that, please feel free to clone/fork/take the repo over, and go for it!

Got it! I am willing, and I am actually working on ports to build for 10.6 PPC, but I will need to review my changes and amend them to be acceptable for public sharing (as long as it was just on my machine, I needed not care about existence of anything else).

If I will really need some help that is specific to 10.6 PPC, where may I ask you (or anyone)? It may not ever be necessary - as long as I can make a port build for ppc-32 on 10.5.8, most likely it can be fixed for 10.6, and I can do that on my end. But just in case.

So far I have far more problems with building universal on 10.5.8 than building natively on 10.6 PPC.

Note: See TracTickets for help on using tickets.