Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 615854 - media-libs/libpano13-2.9.19 fail to compile with undefined reference to `float2rgbe' and 'rgbe2float'
Summary: media-libs/libpano13-2.9.19 fail to compile with undefined reference to `floa...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Markus Meier
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-17 14:15 UTC by Thierry De Leeuw
Modified: 2022-12-24 11:35 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emergeInfo,6.03 KB, text/plain)
2017-04-17 14:15 UTC, Thierry De Leeuw
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thierry De Leeuw 2017-04-17 14:15:17 UTC
Created attachment 470252 [details]
emerge --info

When compiling the libpan13, I get the following errors
/tmp/portage/media-libs/libpano13-2.9.19/work/libpano13-2.9.19/.libs/libpano13.so: undefined reference to `float2rgbe'
/tmp/portage/media-libs/libpano13-2.9.19/work/libpano13-2.9.19/.libs/libpano13.so: undefined reference to `rgbe2float'

This is likely caused by the INLINE use in rgbe.h

INLINE void float2rgbe(unsigned char rgbe[4], float red, float green, float blue);
INLINE void rgbe2float(float *red, float *green, float *blue, unsigned char rgbe[4]);
Comment 1 Sven Müller 2017-05-26 12:13:45 UTC
Can confirm this error. As a workaround it helps to remove the INLINE keywords. 

For some reason it works with inline on my other machine, which has been updated more recently.
Comment 2 John Bowler 2018-09-20 23:22:35 UTC
I just saw this with gcc 7.3.0 and -Os.  It does, however, build with -O2.  This is because -Os inlines less frequently than -O2 and so the undefined references are from cases which did not get inlined.  Likely as not this will be compiler/version/option dependent.  I don't know if this is a gcc bug or a libpano13 bug.  My understanding was that if the compiler does not inline something it should include an out-of-line version in the object module.
Comment 3 kavol 2020-05-27 11:40:14 UTC
I can confirm this, compilation with -Os fails, using -O2 it goes fine.

I'd suspect toolchain here, because libpano13 is the same version for quite a time, while other things changed, and those years ago, I've emerged it without problem - it failed now while doing `emerge -e world`.
Comment 4 Martin 2020-07-24 23:46:03 UTC
Confirmed that this fails to compile with -Os:

/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/media-libs/libpano13-2.9.19/work/libpano13-2.9.19/.libs/libpano13.so: undefined reference to `float2rgbe'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/media-libs/libpano13-2.9.19/work/libpano13-2.9.19/.libs/libpano13.so: undefined reference to `rgbe2float'
collect2: error: ld returned 1 exit status


For the compile:

Host system type : x86_64-pc-linux-gnu

                  Option                        Value
-------------------------------------------------------------------------
Shared libraries  --enable-shared=yes          
Static libraries  --enable-static=no          
JPEG              --with-jpeg=          have_jpeg = yes
PNG               --with-png=            have_png  = yes
TIFF              --with-tiff=          have_tiff = yes
ZLIB              --with-zlib=          have_zlib = yes
JAVA              --with-java=no          have_java = no

Options used to compile and link:
  PREFIX         = /usr
  VERSION        = 2.9.19
  CC             = x86_64-pc-linux-gnu-gcc
  CFLAGS         = -march=native -mtune=native -Os -fomit-frame-pointer -pipe -fstack-protector-strong
  CPPFLAGS       = 
  DEFS           = -DHAVE_CONFIG_H
  LDFLAGS        = -Wl,-O1 -Wl,--as-needed
  LIBS           = -lm
  CXX            = 
  CXXFLAGS       = -march=native -mtune=native -Os -fomit-frame-pointer -pipe -fstack-protector-strong
  JPEG_FLAGS     = -DHasJPEG
  LIB_JPEG       = -ljpeg
  PNG_FLAGS      = -DHasPNG
  LIB_PNG        = -lpng
  TIFF_FLAGS     = -DHasTIFF
  LIB_TIFF       = -ltiff
  ZLIB_FLAGS     = -DHasZLIB
  LIB_ZLIB       = -lz
  JAVA_FLAGS     = 
  ENDIAN_FLAG    =

- for gcc (Gentoo 9.3.0-r1 p3) 9.3.0

That fails as described.


Whereas using -O2 for gcc is successful:

Options used to compile and link:
  PREFIX         = /usr
  VERSION        = 2.9.19
  CC             = x86_64-pc-linux-gnu-gcc
  CFLAGS         = -march=native -mtune=native -O2 -fomit-frame-pointer -pipe -fstack-protector-strong
  CPPFLAGS       = 
  DEFS           = -DHAVE_CONFIG_H
  LDFLAGS        = -Wl,-O1 -Wl,--as-needed
  LIBS           = -lm
  CXX            = 
  CXXFLAGS       = -march=native -mtune=native -O2 -fomit-frame-pointer -pipe -fstack-protector-strong
  JPEG_FLAGS     = -DHasJPEG
  LIB_JPEG       = -ljpeg
  PNG_FLAGS      = -DHasPNG
  LIB_PNG        = -lpng
  TIFF_FLAGS     = -DHasTIFF
  LIB_TIFF       = -ltiff
  ZLIB_FLAGS     = -DHasZLIB
  LIB_ZLIB       = -lz
  JAVA_FLAGS     = 
  ENDIAN_FLAG    = 

That successfully compiles and installs (the only change is the -O2).


Thanks for a very curious bug report!

Regards,
Martin