danielgtaylor / jpeg-archive

Utilities for archiving JPEGs for long term storage.
1.16k stars 121 forks source link

Update to GCC 10 changes #119

Open TomaszGasior opened 4 years ago

TomaszGasior commented 4 years ago

I am packaging jpeg-archive for Fedora in my COPR repository. In Fedora 32 GCC will be updated to 10 version where there is some change in default configuration, please see here: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/RYVPP45PMWPXYBBDKXO3CI7YGL7CDQG6/

I am not C programmer, I can't tell details. Currently I am not able to build jpeg-archive for Fedora 32 and Fedora Rawhide. This is error message:

...
make[1]: Leaving directory '/builddir/build/BUILD/jpeg-archive-2.2.0/src/iqa'
cc -std=c99 -Wall -O3 -I/opt/mozjpeg/include -o jpeg-recompress jpeg-recompress.c src/util.o src/edit.o src/smallfry.o src/iqa/build/release/libiqa.a /opt/mozjpeg/lib64/libjpeg.a -lm
/usr/bin/ld: src/util.o:(.data+0x0): multiple definition of `VERSION'; /tmp/ccAX4593.o:(.bss+0x28): first defined here
/usr/bin/ld: src/util.o:(.bss+0x0): multiple definition of `progname'; /tmp/ccAX4593.o:(.bss+0x20): first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:42: jpeg-recompress] Error 1
dbkblk commented 3 years ago

The same error occurs when building from Debian 11:

make[1] : on quitte le répertoire « /mnt/lent/Apps/jpeg-archive-2.2.0/src/iqa »
cc -std=c99 -Wall -O3 -I/opt/mozjpeg/include -o jpeg-recompress jpeg-recompress.c src/util.o src/edit.o src/smallfry.o src/iqa/build/release/libiqa.a /opt/mozjpeg/lib64/libjpeg.a -lm
/usr/bin/ld : src/util.o:(.data.rel.local+0x0) : définitions multiples de « VERSION »; /tmp/ccTrjeDy.o:(.bss+0x28) : défini pour la première fois ici
/usr/bin/ld : src/util.o:(.bss+0x0) : définitions multiples de « progname »; /tmp/ccTrjeDy.o:(.bss+0x20) : défini pour la première fois ici
collect2: error: ld returned 1 exit status
make: *** [Makefile:42 : jpeg-recompress] Erreur 1

For those wondering how to build it on Debian 11, install:

sudo apt install gcc-9 gcc9-base
make CC=gcc-9
sudo make install

Althought I recommand this instead of make install: sudo checkinstall

zeroheure commented 3 years ago

See my PR : just add -fcommon to CFLAGS in the Makefile.

yorkane commented 2 years ago

See my PR : just add -fcommon to CFLAGS in the Makefile.

Thanks a lot!