#65854 closed defect (fixed)

glib2 @2.70.5_0: build fails on 10.5 PPC: pragma GCC diagnostic not allowed inside functions

Reported by: ballapete (Peter "Pete" Dyballa) Owned by: mascguy (Christopher Nielsen)
Priority: Normal Milestone:
Component: ports Version: 2.7.2
Keywords: leopard ppc Cc: barracuda156, evanmiller (Evan Miller), khepler
Port: glib2

Description

[107/1201] /usr/bin/gcc-4.2 -Iglib/tests/atomic.p -Iglib/tests -I../glib-2.70.5/glib/tests -I. -I../glib-2.70.5 -Iglib -I../glib-2.70.5/glib -I/opt/local/include -std=gnu99 -O2 -g -D_GNU_SOURCE -fno-strict-aliasing -DG_ENABLE_DEBUG -Wstrict-prototypes -Wunused -Wno-unused-parameter -Wno-bad-function-cast -Wno-format-zero-length -Werror=declaration-after-statement -Werror=format=2 -Werror=implicit-function-declaration -Werror=init-self -Werror=missing-include-dirs -Werror=missing-prototypes -Werror=pointer-arith -pipe -Os -fstrict-aliasing -Wno-deprecated-declarations -arch ppc '-DG_LOG_DOMAIN="GLib"' -UG_DISABLE_ASSERT -Wstrict-aliasing=2 -MD -MQ glib/tests/atomic.p/atomic.c.o -MF glib/tests/atomic.p/atomic.c.o.d -o glib/tests/atomic.p/atomic.c.o -c ../glib-2.70.5/glib/tests/atomic.c
FAILED: glib/tests/atomic.p/atomic.c.o 
/usr/bin/gcc-4.2 -Iglib/tests/atomic.p -Iglib/tests -I../glib-2.70.5/glib/tests -I. -I../glib-2.70.5 -Iglib -I../glib-2.70.5/glib -I/opt/local/include -std=gnu99 -O2 -g -D_GNU_SOURCE -fno-strict-aliasing -DG_ENABLE_DEBUG -Wstrict-prototypes -Wunused -Wno-unused-parameter -Wno-bad-function-cast -Wno-format-zero-length -Werror=declaration-after-statement -Werror=format=2 -Werror=implicit-function-declaration -Werror=init-self -Werror=missing-include-dirs -Werror=missing-prototypes -Werror=pointer-arith -pipe -Os -fstrict-aliasing -Wno-deprecated-declarations -arch ppc '-DG_LOG_DOMAIN="GLib"' -UG_DISABLE_ASSERT -Wstrict-aliasing=2 -MD -MQ glib/tests/atomic.p/atomic.c.o -MF glib/tests/atomic.p/atomic.c.o.d -o glib/tests/atomic.p/atomic.c.o -c ../glib-2.70.5/glib/tests/atomic.c
../glib-2.70.5/glib/tests/atomic.c: In function ‘test_types’:
../glib-2.70.5/glib/tests/atomic.c:100: error: #pragma GCC diagnostic not allowed inside functions
../glib-2.70.5/glib/tests/atomic.c:101: error: #pragma GCC diagnostic not allowed inside functions
../glib-2.70.5/glib/tests/atomic.c:105: error: #pragma GCC diagnostic not allowed inside functions
ninja: build stopped: subcommand failed.
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_devel_glib2/glib2/work/build" && /opt/local/bin/ninja -j1 --verbose -v 

Attachments (3)

main.log (392.7 KB) - added by ballapete (Peter "Pete" Dyballa) 19 months ago.
Main.log from PPC Leopard
patch-glib_tests_atomic.c-pragmas-1.diff (719 bytes) - added by ballapete (Peter "Pete" Dyballa) 19 months ago.
Simple patch to remove the three #pragma lines
patch-glib_tests_atomic.c-pragmas-2.diff (858 bytes) - added by ballapete (Peter "Pete" Dyballa) 19 months ago.
Simple patch to comment the three #pragma lines

Download all attachments as: .zip

Change History (11)

Changed 19 months ago by ballapete (Peter "Pete" Dyballa)

Attachment: main.log added

Main.log from PPC Leopard

comment:1 Changed 19 months ago by mascguy (Christopher Nielsen)

Cc: barracuda156 evanmiller added; mascguy@… removed
Keywords: ppc added
Owner: set to mascguy
Status: newassigned
Summary: glib2 @2.70.5_0 does not build on PPC Leopard, Mac OS X 10.5.8, because #pragma GCC diagnostic not allowed inside functionsglib2 @2.70.5_0: build fails on 10.5 PPC: pragma GCC diagnostic not allowed inside functions

comment:2 Changed 19 months ago by ballapete (Peter "Pete" Dyballa)

glib2 builds when the three lines are either removed or commented.

BTW, I get quite a lot of complaints like this one:

/usr/bin/gnutar: glib-2.70.5/.clang-format: implausibly old time stamp 1970-01-01 01:00:00

GCC 4.2 complaints also a lot of times:

../glib-2.70.5/glib/gdate.c:2636: warning: expected [error|warning|ignored] after ‘#pragma GCC diagnostic’
../glib-2.70.5/glib/gdate.c:2750: warning: expected [error|warning|ignored] after ‘#pragma GCC diagnostic’
../glib-2.70.5/glib/gfileutils.c:646: warning: expected [error|warning|ignored] after ‘#pragma GCC diagnostic’
../glib-2.70.5/glib/gfileutils.c:664: warning: expected [error|warning|ignored] after ‘#pragma GCC diagnostic’
../glib-2.70.5/glib/gmarkup.c:2467: warning: expected [error|warning|ignored] after ‘#pragma GCC diagnostic’
../glib-2.70.5/glib/gmarkup.c:2596: warning: expected [error|warning|ignored] after ‘#pragma GCC diagnostic’
../glib-2.70.5/glib/gmessages.c:1606: warning: expected [error|warning|ignored] after ‘#pragma GCC diagnostic’
../glib-2.70.5/glib/gmessages.c:1917: warning: expected [error|warning|ignored] after ‘#pragma GCC diagnostic’
../glib-2.70.5/glib/gstrfuncs.c:925: warning: expected [error|warning|ignored] after ‘#pragma GCC diagnostic’
../glib-2.70.5/glib/gstrfuncs.c:1037: warning: expected [error|warning|ignored] after ‘#pragma GCC diagnostic’
../glib-2.70.5/glib/gutils.c:2731: warning: expected [error|warning|ignored] after ‘#pragma GCC diagnostic’
../glib-2.70.5/glib/gutils.c:2945: warning: expected [error|warning|ignored] after ‘#pragma GCC diagnostic’
../glib-2.70.5/glib/tests/atomic.c:100: error: #pragma GCC diagnostic not allowed inside functions
../glib-2.70.5/glib/tests/atomic.c:101: error: #pragma GCC diagnostic not allowed inside functions
../glib-2.70.5/glib/tests/atomic.c:105: error: #pragma GCC diagnostic not allowed inside functions
../glib-2.70.5/glib/tests/gdatetime.c:2431: warning: expected [error|warning|ignored] after ‘#pragma GCC diagnostic’
../glib-2.70.5/glib/tests/gdatetime.c:2458: warning: expected [error|warning|ignored] after ‘#pragma GCC diagnostic’
../glib-2.70.5/glib/tests/test-printf.c:197: warning: expected [error|warning|ignored] after ‘#pragma GCC diagnostic’
../glib-2.70.5/glib/tests/test-printf.c:216: warning: expected [error|warning|ignored] after ‘#pragma GCC diagnostic’
../glib-2.70.5/glib/tests/1bit-mutex.c:27: warning: expected [error|warning|ignored] after ‘#pragma GCC diagnostic’
../glib-2.70.5/glib/tests/1bit-mutex.c:56: warning: expected [error|warning|ignored] after ‘#pragma GCC diagnostic’
../glib-2.70.5/gio/glocalfile.c:904: warning: expected [error|warning|ignored] after ‘#pragma GCC diagnostic’
../glib-2.70.5/gio/glocalfile.c:920: warning: expected [error|warning|ignored] after ‘#pragma GCC diagnostic’

Changed 19 months ago by ballapete (Peter "Pete" Dyballa)

Simple patch to remove the three #pragma lines

Changed 19 months ago by ballapete (Peter "Pete" Dyballa)

Simple patch to comment the three #pragma lines

comment:3 Changed 19 months ago by mascguy (Christopher Nielsen)

Thanks for the ticket, as well as the patches.

Can you also test building glib2-devel, as well as glib2-upstream? (Note that the latter was just updated 2 hours ago, so be sure to sync your ports tree.)

That way we can hopefully get this all working now, to avoid breakage when we update glib2 again.

comment:4 in reply to:  3 Changed 19 months ago by ballapete (Peter "Pete" Dyballa)

Replying to mascguy: In a few hours! I am trying to upgrade all other ports first…

comment:5 Changed 19 months ago by ballapete (Peter "Pete" Dyballa)

glib2-devel built with Python 3.9 instead of Python 3.10 in more than one hour. Over 400 times I was warned:

./config.h:366:0: warning: "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4" redefined

comment:6 Changed 19 months ago by ballapete (Peter "Pete" Dyballa)

glib2-upstream built with Python 3.9 instead of Python 3.10 in less than an hour. Over 400 times I was warned again:

./config.h:370:0: warning: "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4" redefined

comment:7 Changed 17 months ago by khepler

Cc: khepler added

comment:8 Changed 16 months ago by kencu (Ken)

Resolution: fixed
Status: assignedclosed

In bf232c7a084bee232ee1e6988402b6c9688fc200/macports-ports (master):

glib2: fix build with older gccs

they don't accept pragmas inside functions
just test against compiler matches gcc for now

closes: #65854

Note: See TracTickets for help on using tickets.