Problem found when building sysutils/libcdio on FreeBSD 12.1-RELEASE-p1 powerpc 32 bit, running on Apple Powerbook 17". (sysutils/libcdio is a requirement to build xfce4) # cd ../../sysutils/libcdio # make -DBATCH install clean ===> Building for libcdio-2.1.0 gmake[1]: Entering directory '/usr/ports/sysutils/libcdio/work/libcdio-2.1.0' gmake all-recursive ..... ..... gmake[4]: Leaving directory '/usr/ports/sysutils/libcdio/work/libcdio-2.1.0/lib/driver' Making all in iso9660 gmake[4]: Entering directory '/usr/ports/sysutils/libcdio/work/libcdio-2.1.0/lib/iso9660' depbase=`echo iso9660.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\ /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../../lib/driver -I../../include -I../../include/ -DLIBICONV_PLUG -isystem /usr/local/include -O2 -pipe -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -Wall -Wbad-function-cast -Wcast-align -Wchar-subscripts -Wdeclaration-after-statement -Wdisabled-optimization -Wendif-labels -Winline -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-sign-compare -Wpointer-arith -Wshadow -Wstrict-prototypes -Wundef -Wunused -Wwrite-strings -MT iso9660.lo -MD -MP -MF $depbase.Tpo -c -o iso9660.lo iso9660.c &&\ mv -f $depbase.Tpo $depbase.Plo libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../../lib/driver -I../../include -I../../include/ -DLIBICONV_PLUG -isystem /usr/local/include -O2 -pipe -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -Wall -Wbad-function-cast -Wcast-align -Wchar-subscripts -Wdeclaration-after-statement -Wdisabled-optimization -Wendif-labels -Winline -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-sign-compare -Wpointer-arith -Wshadow -Wstrict-prototypes -Wundef -Wunused -Wwrite-strings -MT iso9660.lo -MD -MP -MF .deps/iso9660.Tpo -c iso9660.c -fPIC -DPIC -o .libs/iso9660.o iso9660.c: In function 'iso9660_set_ltime_with_timezone': iso9660.c:376: error: #pragma GCC diagnostic not allowed inside functions gmake[4]: *** [Makefile:605: iso9660.lo] Error 1 gmake[4]: Leaving directory '/usr/ports/sysutils/libcdio/work/libcdio-2.1.0/lib/iso9660' gmake[3]: *** [Makefile:423: all-recursive] Error 1 gmake[3]: Leaving directory '/usr/ports/sysutils/libcdio/work/libcdio-2.1.0/lib' gmake[2]: *** [Makefile:577: all-recursive] Error 1 gmake[2]: Leaving directory '/usr/ports/sysutils/libcdio/work/libcdio-2.1.0' gmake[1]: *** [Makefile:474: all] Error 2 gmake[1]: Leaving directory '/usr/ports/sysutils/libcdio/work/libcdio-2.1.0' ===> Compilation failed unexpectedly. Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to the maintainer. *** Error code 1 Stop. make: stopped in /usr/ports/sysutils/libcdio
Created attachment 210068 [details] Disable GCC diagnostic pragma for older GCC Canardo, could you please test this patch and report back? I am not able to test it myself.
Hi Jason, kind warning : I'm no developer, but I tried my best. Based on doc '4.4. Patching' Here is what I did: save the attach file (46 lines of text), under the name 'patch-lib_iso9660_iso9660.c' tranfert it to the FreeBSD machine, in folder '/usr/ports/sysutils/libcdio/files' then # cd /usr/ports/sysutils/libcdio # make clean # make install clean Then I get the same error as before, but I'm not sure your patch has been properly applied. Please find the full log attached. Any guidance is welcome, I'm willing to learn.
Created attachment 210069 [details] log after applying patch
(In reply to canardo from comment #3) Try this instead: rm /usr/ports/sysutils/libcdio/files/patch-lib_iso9660_iso9660.c fetch -o libcdio.patch 'https://bz-attachments.freebsd.org/attachment.cgi?id=210068&action=diff&format=raw&headers=1' patch -d /usr/ports/ < libcdio.patch make -C /usr/ports/sysutils/libcdio/ clean install
(In reply to mikael.urankar from comment #4) Following your command lines above, patch has been successfully applied, and sysutils/libcdio is now built without errors. Thanks a lot for your help.
A commit references this bug: Author: jhale Date: Fri Dec 20 13:03:25 UTC 2019 New revision: 520503 URL: https://svnweb.freebsd.org/changeset/ports/520503 Log: sysutils/libcdio: Fix build with GCC versions older than 4.6.0 which do not allow "#pragma GCC diagnostic" to be used inside of functions PR: 242693 Reported by: canardo <canardo909@gmx.com> Changes: head/sysutils/libcdio/files/patch-lib_iso9660_iso9660.c
Patch committed. Thanks for the report and for testing!