Opened 5 years ago

Closed 3 years ago

#59658 closed defect (fixed)

babl @ 0.1.74_1: fails to configure on systems that raise linker warnings: ERROR: Problem encountered: Linker doesn't support --version-script or -exported_symbols_list

Reported by: kencu (Ken) Owned by: mascguy (Christopher Nielsen)
Priority: Normal Milestone:
Component: ports Version:
Keywords: haspatch Cc: evanmiller (Evan Miller)
Port: babl

Description

The default linker on Leopard ld64_127 is not new enough to satisfy the meson configure script:

--->  Computing dependencies for babl.
--->  Fetching distfiles for babl
--->  babl-0.1.72.tar.xz does not exist in /opt/local/var/macports/distfiles/babl
--->  Attempting to fetch babl-0.1.72.tar.xz from http://distfiles.macports.org/babl
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  286k  100  286k    0     0   257k      0  0:00:01  0:00:01 --:--:--  258k
--->  Verifying checksums for babl
--->  Checksumming babl-0.1.72.tar.xz
--->  Extracting babl
--->  Extracting babl-0.1.72.tar.xz
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_babl/babl/work" && /opt/local/bin/xz -dc '/opt/local/var/macports/distfiles/babl/babl-0.1.72.tar.xz' | /usr/bin/gnutar --no-same-owner -xf - 
--->  Applying patches to babl
--->  Applying meson-add-dylib-for-macos.patch
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_babl/babl/work/babl-0.1.72" && /usr/bin/patch -p0 < '/opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/graphics/babl/files/meson-add-dylib-for-macos.patch'
patching file meson.build
--->  Applying meson-fix-darwin-clang-map.patch
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_babl/babl/work/babl-0.1.72" && /usr/bin/patch -p0 < '/opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/graphics/babl/files/meson-fix-darwin-clang-map.patch'
patching file babl/meson.build
patching file babl/test-clang.map
patching file babl/test-gnu.map
patching file gen_babl_map.py
--->  Configuring babl
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_babl/babl/work/babl-0.1.72" && /opt/local/bin/meson --prefix=/opt/local /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_babl/babl/work/babl-0.1.72 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_babl/babl/work/build 
The Meson build system
Version: 0.52.0
Source dir: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_babl/babl/work/babl-0.1.72
Build dir: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_babl/babl/work/build
Build type: native build
Project name: babl
Project version: 0.1.72
Appending CFLAGS from environment: '-pipe -Os -arch i386'
Appending LDFLAGS from environment: ['-L/opt/local/lib', '-Wl,-headerpad_max_install_names', '-arch', 'i386']
Appending CPPFLAGS from environment: '-I/opt/local/include'
Appending CFLAGS from environment: '-pipe -Os -arch i386'
Appending LDFLAGS from environment: ['-L/opt/local/lib', '-Wl,-headerpad_max_install_names', '-arch', 'i386']
Appending CPPFLAGS from environment: '-I/opt/local/include'
C compiler for the host machine: /opt/local/bin/clang-mp-7.0 (clang 7.0.1 "clang version 7.0.1 (tags/RELEASE_701/final)")
C linker for the host machine: APPLE ld 127.2
Host machine cpu family: x86
Host machine cpu: i386
Message: Architecture: i386
Message: Host os: darwin
Message: Build os: darwin
Compiler for C supports arguments -Ofast: YES 
Compiler for C supports arguments -Wdeclaration-after-statement: YES 
Compiler for C supports arguments -Winit-self: YES 
Compiler for C supports arguments -Wmissing-declarations: YES 
Compiler for C supports arguments -Wmissing-prototypes: YES 
Compiler for C supports arguments -Wold-style-definition: YES 
Compiler for C supports arguments -Wpointer-arith: YES 
Compiler for C supports arguments -mmmx: YES 
Message: mmx assembly available
Compiler for C supports arguments -msse: YES 
Message: sse assembly available
Compiler for C supports arguments -mfpmath=sse: YES 
Compiler for C supports arguments -msse2: YES 
Message: sse2 assembly available
Compiler for C supports arguments -msse4.1: YES 
Message: sse4.1 assembly available
Compiler for C supports arguments -mavx2: YES 
Message: avx2 assembly available
Compiler for C supports arguments -mf16c: YES 
Message: Can compile half-floating point code (f16c)
Has header "dlfcn.h" : YES 
Has header "dl.h" : NO 
Checking for function "gettimeofday" : YES 
Checking for function "rint" : YES 
Checking for function "srandom" : YES 
Found pkg-config: /opt/local/bin/pkg-config (0.29.2)
Run-time dependency lcms2 found: YES 2.9
Library m found: YES
Run-time dependency threads found: YES 
Library dl found: YES
Program env found: YES (/usr/bin/env)
Program git found: YES (/opt/local/bin/git)
Program rsvg-convert found: YES (/opt/local/bin/rsvg-convert)
Program test found: YES (/bin/test)
Program w3m found: YES (/opt/local/bin/w3m)
Configuring config.h using configuration
Program python3 found: YES (/opt/local/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7)
Checking if "-Wl,--version-script" links: NO 
Compiler for C supports link arguments -Wl,-exported_symbols_list /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_babl/babl/work/babl-0.1.72/babl/test-clang.map: NO 

babl/meson.build:39:1: ERROR: Problem encountered: Linker doesn't support --version-script or -exported_symbols_list

A full log can be found at /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_babl/babl/work/build/meson-logs/meson-log.txt
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_babl/babl/work/babl-0.1.72" && /opt/local/bin/meson --prefix=/opt/local /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_babl/babl/work/babl-0.1.72 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_babl/babl/work/build 
Exit code: 1
Error: Failed to configure babl: configure failure: command execution failed

It is, however, possible to install ld64_236 on Leopard by using the port libblocksruntime to satisfy the blocks requirement, and then babl can be successfully installed on Leopard.

Change History (19)

comment:1 Changed 5 years ago by kencu (Ken)

Summary: babl @ 0.1.72: fails to configure on Leopard: ERROR: Problem encountered: Linker doesn't support --version-script or -exported_symbols_listbabl @ 0.1.72: fails to configure on Leopard (Intel): ERROR: Problem encountered: Linker doesn't support --version-script or -exported_symbols_list

comment:2 Changed 5 years ago by rmottola (Riccardo)

I add that I encounter the same issue on Snow Leopard 10.6:

Configuring config.h using configuration
Program python3 found: YES (/opt/local/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7)
Checking if "-Wl,--version-script" links: NO 
Compiler for C supports link arguments -Wl,-exported_symbols_list /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_babl/babl/work/babl-0.1.72/babl/test-clang.map: NO 

babl/meson.build:39:1: ERROR: Problem encountered: Linker doesn't support --version-script or -exported_symbols_list

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

On SnowLeopard, you can quite easily use the latest linker that the ld64 port supports, and you should. But it's a manual step, I'm afraid, and I don't know how it could be automated.

It looks like the relevant step has been stripped out of the current LibcxxOnOlderSystems instructions wiki:LibcxxOnOlderSystems?action=diff&version=70, but you have to do this:

  1. Snow Leopard Only: Disable the variants corresponding to the older versions of ld64 in /opt/local/etc/macports/variants.conf. This ensures that ld64 will be reinstalled using the appropriate variants in the future:
    -ld64_97
    -ld64_127
    -ld64_236
    
  2. Snow Leopard Only: Reinstall ld64 with the legacy variants disabled to use ld64-latest as the default linker and deactivate the bootstrap linker:
    sudo port -v upgrade --enforce-variants ld64 -ld64_97 -ld64_127 -ld64_236
    sudo port -v deactivate ld64-127
    
Last edited 5 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

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

I guess it was hoped that ld64_127 would hold up and be sufficient on SnowLeopard, but I don't think so -- I have never really used that linker for much.

I haven't pushed the new build I made for ld64_236 very hard on Leopard, but I know it's not perfect... Iain Sandoe, genius extraordinaire, has a much-more-robust newish ld64 274 running on 10.5 PPC and Intel <https://github.com/iains/darwin-xtools> that I have been wondering if I might someday integrate into MacPorts

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

Replying to kencu:

On SnowLeopard, you can quite easily use the latest linker that the ld64 port supports, and you should. But it's a manual step, I'm afraid, and I don't know how it could be automated.

Add a dependency to the babl port?

This problem causes babl, and of course everything that depends on it, to fail on the 10.6 buildbot workers.

comment:6 Changed 5 years ago by rmottola (Riccardo)

Any progress on this? I still have it on 10.6 (didn't try 10.5 yet....)

comment:7 Changed 5 years ago by rmottola (Riccardo)

@kencu, @ryandesign - I followed the instruction points 8 & 9 on SnowLeopard 10.6 universal. I hope that linker will not have other fallout!

Configuration then starts, but compilation still fails with this:

[22/184] Compiling C object 'babl/4170c83@@babl-0.1@sha/babl-cpuaccel.c.o'.
FAILED: babl/4170c83@@babl-0.1@sha/babl-cpuaccel.c.o 
/opt/local/bin/clang-mp-9.0 -Ibabl/4170c83@@babl-0.1@sha -Ibabl -I../babl-0.1.72/babl -I. -I../babl-0.1.72/ -Ibabl/base -I../babl-0.1.72/babl/base -I/opt/local/include -Xclang -fcolor-diagnostics -pipe -Wall -Winvalid-pch -g -Ofast -Wdeclaration-after-statement -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wold-style-definition -Wpointer-arith -mmmx -msse -mfpmath=sse -Os -arch x86_64 -msse2 '-DLIBDIR="/opt/local/lib"' -MD -MQ 'babl/4170c83@@babl-0.1@sha/babl-cpuaccel.c.o' -MF 'babl/4170c83@@babl-0.1@sha/babl-cpuaccel.c.o.d' -o 'babl/4170c83@@babl-0.1@sha/babl-cpuaccel.c.o' -c ../babl-0.1.72/babl/babl-cpuaccel.c
../babl-0.1.72/babl/babl-cpuaccel.c:161:12: error: instruction requires: Not 64-bit mode
  __asm__ ("pushfl\n\t"
           ^
<inline asm>:1:2: note: instantiated into assembly here
        pushfl
        ^
../babl-0.1.72/babl/babl-cpuaccel.c:161:21: error: instruction requires: Not 64-bit mode
  __asm__ ("pushfl\n\t"
                    ^
<inline asm>:2:2: note: instantiated into assembly here
        pushfl
        ^
../babl-0.1.72/babl/babl-cpuaccel.c:162:21: error: instruction requires: Not 64-bit mode
           "pushfl\n\t"
                    ^
<inline asm>:3:2: note: instantiated into assembly here
        popl %eax
        ^
../babl-0.1.72/babl/babl-cpuaccel.c:165:32: error: instruction requires: Not 64-bit mode
           "xorl $0x200000,%0\n\t"
                               ^
<inline asm>:6:2: note: instantiated into assembly here
        pushl %eax
        ^
../babl-0.1.72/babl/babl-cpuaccel.c:166:23: error: instruction requires: Not 64-bit mode
           "pushl %0\n\t"
                      ^
<inline asm>:7:2: note: instantiated into assembly here
        popfl
        ^
../babl-0.1.72/babl/babl-cpuaccel.c:167:20: error: instruction requires: Not 64-bit mode
           "popfl\n\t"
                   ^
<inline asm>:8:2: note: instantiated into assembly here
        pushfl
        ^
../babl-0.1.72/babl/babl-cpuaccel.c:168:21: error: instruction requires: Not 64-bit mode
           "pushfl\n\t"
                    ^
<inline asm>:9:2: note: instantiated into assembly here
        popl %eax
        ^
../babl-0.1.72/babl/babl-cpuaccel.c:169:22: error: instruction requires: Not 64-bit mode
           "popl %0\n\t"
                     ^
<inline asm>:10:2: note: instantiated into assembly here
        popfl
        ^
8 errors generated.
[23/184] Compiling C object 'babl/4170c83@@babl-0.1@sha/babl-fish-path.c.o'.
ninja: build stopped: subcommand failed.

As you see, compiler automatically selected is clang 9. Clang 5 & 3.7 fail the same. GCC is not usable, it is refused! What does clang use or the inline asm ?

comment:8 Changed 5 years ago by kencu (Ken)

This is another recognized issue, in meson, different than the linker issue. We have had a fix for it for some weeks, but have not pushed it through MacPorts as yet. #59675 It takes only a few seconds to do a workaround install while it is sorted out what to do.

I could push the meson fix up in less than two minutes, but I don't think it would be committed so I haven't bothered. Ryan, if you would accept the patch, let me know and I'll push it through.

Waiting for meson to sort this out and release a fix could take months, though.

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

This PR <https://github.com/macports/macports-ports/pull/6069> is an attempt to fix this.

comment:10 Changed 5 years ago by kencu (Ken)

This linker error is not simply occurring because the linker is too old. On 10.13, with Xcode 10, I see this same error trying to build babl +universal. I do not see it building babl without universal.

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

It has to do with warnings coming out of the linker, which causes the linker test to fail. How to turn off these warnings is not so easy for me to see (meson has a fatal_warnings setting for linkers, perhaps we can figure out how to toggle that.

Alternatively, do something like this to force the flags:

$ diff -u babl/meson.build.orig babl/meson.build
--- babl/meson.build.orig	2020-03-26 14:37:43.000000000 -0700
+++ babl/meson.build	2020-03-26 14:38:11.000000000 -0700
@@ -36,7 +36,7 @@
   # Clang on Darwin
   babl_link_args = ['-Wl,-exported_symbols_list',version_script_clang]
 else
-  error('Linker doesn\'t support --version-script or -exported_symbols_list')
+  babl_link_args = ['-Wl,-exported_symbols_list',version_script_clang]
 endif
 if platform_win32
   babl_link_args += '-Wl,--no-undefined'

comment:12 Changed 5 years ago by kencu (Ken)

Keywords: haspatch added

comment:13 Changed 5 years ago by kencu (Ken)

Summary: babl @ 0.1.72: fails to configure on Leopard (Intel): ERROR: Problem encountered: Linker doesn't support --version-script or -exported_symbols_listbabl @ 0.1.74_1: fails to configure systems that raise linker warnings: ERROR: Problem encountered: Linker doesn't support --version-script or -exported_symbols_list

comment:14 Changed 5 years ago by kencu (Ken)

Summary: babl @ 0.1.74_1: fails to configure systems that raise linker warnings: ERROR: Problem encountered: Linker doesn't support --version-script or -exported_symbols_listbabl @ 0.1.74_1: fails to configure on systems that raise linker warnings: ERROR: Problem encountered: Linker doesn't support --version-script or -exported_symbols_list

comment:16 Changed 3 years ago by mascguy (Christopher Nielsen)

Owner: changed from dbevans to mascguy

Reassign babl-related tickets to me

comment:17 Changed 3 years ago by evanmiller (Evan Miller)

In 0ef4ecc53976cbddb9635ac9e5f3787fc7fd1d71/macports-ports (master):

babl-devel: fix GCC builds

Patches from @kencu's TigerPorts

See: #59658
See: #59659

comment:18 Changed 3 years ago by mascguy (Christopher Nielsen)

Cc: evanmiller added

comment:19 Changed 3 years ago by Christopher Nielsen <mascguy@…>

Resolution: fixed
Status: assignedclosed

In c234fe89edc847df9ff692e4eead0df3c3a88be1/macports-ports (master):

babl: reconcile with babl-devel, including latest patches
Fixes: #59658
Fixes: #59659

Note: See TracTickets for help on using tickets.