Bug 242693 - [PowerPC] sysutils/libcdio fails to build on FreeBSD 12.1-RELEASE-p1 32 bit: libapr-1.so: pragma GCC diagnostic not allowed inside functions
Summary: [PowerPC] sysutils/libcdio fails to build on FreeBSD 12.1-RELEASE-p1 32 bit: ...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: powerpc Any
: --- Affects Only Me
Assignee: Jason E. Hale
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-17 22:17 UTC by canardo
Modified: 2019-12-20 13:05 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (jhale)


Attachments
Disable GCC diagnostic pragma for older GCC (1.49 KB, patch)
2019-12-19 16:14 UTC, Jason E. Hale
jhale: maintainer-approval+
Details | Diff
log after applying patch (94.44 KB, text/plain)
2019-12-19 17:26 UTC, canardo
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description canardo 2019-12-17 22:17:09 UTC
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
Comment 1 Jason E. Hale freebsd_committer freebsd_triage 2019-12-19 16:14:07 UTC
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.
Comment 2 canardo 2019-12-19 17:26:07 UTC
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.
Comment 3 canardo 2019-12-19 17:26:59 UTC
Created attachment 210069 [details]
log after applying patch
Comment 4 Mikael Urankar freebsd_committer freebsd_triage 2019-12-19 17:53:26 UTC
(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
Comment 5 canardo 2019-12-19 23:32:39 UTC
(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.
Comment 6 commit-hook freebsd_committer freebsd_triage 2019-12-20 13:03:47 UTC
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
Comment 7 Jason E. Hale freebsd_committer freebsd_triage 2019-12-20 13:05:27 UTC
Patch committed. Thanks for the report and for testing!