Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ghostscript-10.02.0-1: error: lcms2 not found, or too old #1084

Open
cooljeanius opened this issue Oct 14, 2023 · 10 comments
Open

ghostscript-10.02.0-1: error: lcms2 not found, or too old #1084

cooljeanius opened this issue Oct 14, 2023 · 10 comments

Comments

@cooljeanius
Copy link

cooljeanius commented Oct 14, 2023

ghostscript fails to upgrade during its configure step:

checking for local lcms2mt library source... no
checking for local lcms2 library source... no
checking for system lcms2 library... checking for cmsCloneTransformChangingFormats in -llcms2mt... no
configure: error: lcms2 not found, or too old
### execution of /tmp/fink.JPzEc failed, exit code 1
### execution of /tmp/fink.yowoI failed, exit code 1
Removing runtime build-lock...
Removing build-lock package...
/opt/sw/bin/dpkg-lockwait -r fink-buildlock-ghostscript-10.02.0-1
(Reading database ... 
dpkg: serious warning: files list file for package `fink-buildlock-ccp4-6.5-1' missing, assuming package has no files currently installed.
1036159 files and directories currently installed.)
Removing fink-buildlock-ghostscript-10.02.0-1 ...

config.log says:

configure:8868: checking for cmsCloneTransformChangingFormats in -llcms2mt
configure:8893: flag-sort gcc -o conftest  -DHAVE_RESTRICT=1 -DUSE_LIBICONV_GNU -I/opt/sw/include -DUSE_LIBPAPER -MD -Wno-shift-negative-value -I/opt/sw/include -L/opt/sw/lib/0 -L/opt/sw/lib -Wl,-headerpad_max_install_names conftest.c -llcms2mt  -lm -ldl  -liconv -L/opt/sw/lib -lidn -lpaper >&5
ld: warning: directory not found for option '-L/opt/sw/lib/0'
Undefined symbols for architecture x86_64:
  "_cmsCloneTransformChangingFormats", referenced from:
      _main in conftest-34a14d.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I do in fact have lcms2 installed:

$ fink apropos lcms2
Information about 15258 packages read in 5 seconds.
 i   lcms2                                              2.15-1                                 Free color management engine in 100K
 i   lcms2-bin                                          2.15-1                                 Free color management engine in 100K
 i   lcms2-shlibs                                       2.15-1                                 Free color management engine in 100K
 i   lcms2mt2                                           2.12-1                                 Color management engine (multithreaded)
 i   lcms2mt2-shlibs                                    2.12-1                                 Color management engine (multithreaded)

(I'm on Big Sur with Xcode 13)

@dmacks
Copy link
Member

dmacks commented Oct 14, 2023

This is specifically about lcms2mt, not lcms2 itself. Seems like it is getting mis-compiled? On my 10.13, nm /sw/lib/liblcms2mt.dylib | grep _cmsCloneTransformChangingFormats says:

000000000002c580 (__TEXT,__text) external _cmsCloneTransformChangingFormats

@cooljeanius
Copy link
Author

This is specifically about lcms2mt, not lcms2 itself. Seems like it is getting mis-compiled? On my 10.13, nm /sw/lib/liblcms2mt.dylib | grep _cmsCloneTransformChangingFormats says:

000000000002c580 (__TEXT,__text) external _cmsCloneTransformChangingFormats

I get:

$ nm /opt/sw/lib/liblcms2mt.dylib | grep _cmsCloneTransformChangingFormats
000000000002aee0 t _cmsCloneTransformChangingFormats
000000000004b2b0 t _cmsCloneTransformChangingFormats.cold.1

@dmacks
Copy link
Member

dmacks commented Oct 14, 2023

I mis-pasted the 'nm' flags, but regardless I can already see the problem: liblcms2mt is indeed mis-compiled. The symbol is marked private rather than public. During 'fink rebuild lcms2mt2', I see:

checking for __attribute__((visibility))... yes
checking whether C compiler accepts -fvisibility=hidden... yes

I'm going to guess you get no/yes? My config.log has:

configure:16014: checking for __attribute__((visibility))
configure:16036: gcc -o conftest -g -O2 -I/sw/include -L/sw/lib -Wl,-headerpad_max_install_names conftest.c  >&5
configure:16036: $? = 0
configure:16049: result: yes
configure:16072: checking whether C compiler accepts -fvisibility=hidden
configure:16091: gcc -c -g -O2  -fvisibility=hidden -I/sw/include conftest.c >&5
configure:16091: $? = 0
configure:16100: result: yes

@cooljeanius
Copy link
Author

I mis-pasted the 'nm' flags,

Forgot the -m flag? Let me try with that one:

$ nm -m /opt/sw/lib/liblcms2mt.dylib | grep _cmsCloneTransformChangingFormats
000000000002aee0 (__TEXT,__text) non-external (was a private external) _cmsCloneTransformChangingFormats
000000000004b2b0 (__TEXT,__text) non-external _cmsCloneTransformChangingFormats.cold.1

but regardless I can already see the problem: liblcms2mt is indeed mis-compiled. The symbol is marked private rather than public. During 'fink rebuild lcms2mt2', I see:

checking for __attribute__((visibility))... yes
checking whether C compiler accepts -fvisibility=hidden... yes

I'm going to guess you get no/yes?

Correct:

checking for __attribute__((visibility))... no
checking whether C compiler accepts -fvisibility=hidden... yes

My config.log has:

configure:16014: checking for __attribute__((visibility))
configure:16036: gcc -o conftest -g -O2 -I/sw/include -L/sw/lib -Wl,-headerpad_max_install_names conftest.c  >&5
configure:16036: $? = 0
configure:16049: result: yes
configure:16072: checking whether C compiler accepts -fvisibility=hidden
configure:16091: gcc -c -g -O2  -fvisibility=hidden -I/sw/include conftest.c >&5
configure:16091: $? = 0
configure:16100: result: yes

Mine has:

configure:16014: checking for __attribute__((visibility))
configure:16036: gcc -o conftest -g -O2 -I/opt/sw/include -L/opt/sw/lib/0 -L/opt/sw/lib -Wl,-headerpad_max_install_names conftest.c  >&5
ld: warning: directory not found for option '-L/opt/sw/lib/0'
configure:16036: $? = 0
configure:16049: result: no
configure:16072: checking whether C compiler accepts -fvisibility=hidden
configure:16091: gcc -c -g -O2  -fvisibility=hidden -I/opt/sw/include conftest.c >&5
configure:16091: $? = 0
configure:16100: result: yes
configure:16116: : CFLAGS="$CFLAGS"
configure:16119: $? = 0
configure:16144: checking whether byte ordering is bigendian
configure:16159: gcc -c -g -O2 -fvisibility=hidden -I/opt/sw/include conftest.c >&5
configure:16159: $? = 0
configure:16204: gcc -c -g -O2 -fvisibility=hidden -I/opt/sw/include conftest.c >&5
configure:16204: $? = 0
configure:16222: gcc -c -g -O2 -fvisibility=hidden -I/opt/sw/include conftest.c >&5
conftest.c:28:4: error: use of undeclared identifier 'not'
                 not big endian
                 ^
1 error generated.
configure:16222: $? = 1

btw, another line of concern from the lcms2mt2 configure output:

./configure: line 15933: LIB_PLUGINS: command not found

(also, I found it kind of confusing how lcms2mt2 is extracted from the ghostscript sources; I thought there was some sort of circular dependency happening at first, lol...)

@TheSin-
Copy link
Member

TheSin- commented Oct 15, 2023

So looks like the harmless bug that shouldn’t affect anything does affect config scripts :(

try updating fink is inject from latest master and run again I bet it fixes at least that part

@cooljeanius
Copy link
Author

So looks like the harmless bug that shouldn’t affect anything does affect config scripts :(

try updating fink is inject from latest master and run again I bet it fixes at least that part

Do you remember which commit specifically fixed it? I'd like to cherry-pick it.

@dmacks
Copy link
Member

dmacks commented Oct 15, 2023

So looks like the harmless bug that shouldn’t affect anything does affect config scripts :(
try updating fink is inject from latest master and run again I bet it fixes at least that part

Do you remember which commit specifically fixed it? I'd like to cherry-pick it.

These two together:

@cooljeanius
Copy link
Author

So looks like the harmless bug that shouldn’t affect anything does affect config scripts :(
try updating fink is inject from latest master and run again I bet it fixes at least that part

Do you remember which commit specifically fixed it? I'd like to cherry-pick it.

These two together:

OK thanks, I can confirm that rebuilding with a fink that has these 2 commits makes the issue reported here go away.

@dmacks
Copy link
Member

dmacks commented Oct 15, 2023

Yay! GNU autoconf-archive's AX_GCC_FUNC_ATTRIBUTE is indeed fragile in this way (and internally documented as such).

@cooljeanius
Copy link
Author

So I'm not really sure... while I may have worked around the failure locally, I'm wondering if there might be anything else to fix here that's worth keeping the bug open for?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants