Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#40590 closed defect (fixed)

glib2 @2.38.0: error: expected ';' after top level declarator

Reported by: carmine.ventre@… Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.2.0
Keywords: Cc: dbevans (David B. Evans), su-v, cooljeanius (Eric Gallager)
Port: glib2

Description (last modified by ryandesign (Ryan Carsten Schmidt))

Hi I tried to upgrade first and then uninstall and install poppler-0.24.1 unsuccessfully. I get an error in building phase, namely "Error: org.macports.build for port poppler returned: command execution failed".

Looking at the log file I can see the following errors a number of errors regarding missing semicolons or undeclared variables (see attached log file). The error code is

:debug:build Error code: CHILDSTATUS 10572 2
:debug:build Backtrace: command execution failed
    while executing
"system -nice 0 $fullcmdstring"
    ("eval" body line 1)
    invoked from within
"eval system $notty $nice \$fullcmdstring"
    invoked from within
"command_exec build"
    (procedure "portbuild::build_main" line 8)
invoked from within
"$procedure $targetname"

Am I the only one with this problem? Any ideas on how to sort it? Thanks!

Attachments (2)

main.log (431.2 KB) - added by carmine.ventre@… 11 years ago.
log file
patch-revert-409a6db3.diff (2.0 KB) - added by su-v 11 years ago.

Download all attachments as: .zip

Change History (21)

Changed 11 years ago by carmine.ventre@…

Attachment: main.log added

log file

comment:1 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added
Description: modified (diff)
Owner: changed from macports-tickets@… to devans@…
Port: poppler added
Summary: poppler-0.24.1 does not build on Mac OSX 10.7.5poppler @0.24.1: error: expected ';' after top level declarator

Yes the relevant error in the log seems to be:

:info:build /opt/local/include/glib-2.0/glib/gmessages.h:192:34: error: expected ';' after top level declarator
:info:build          ...) G_ANALYZER_NORETURN
:info:build                                  ^
:info:build                                  ;

glib2 was just updated to a new version yesterday. It's possible poppler is not compatible and needs an update. However, I was able to build poppler just now with no problem.

comment:2 in reply to:  1 Changed 11 years ago by carmine.ventre@…

Thanks for your reply.

glib2 was just updated to a new version yesterday. It's possible poppler is not compatible and needs an update. However, I was able to build poppler just now with no problem.

Weird! I am unable to make it work on my machine.

comment:3 Changed 11 years ago by dbevans (David B. Evans)

I just tried rebuilding poppler without any problem using the new glib2 as well.

However, I'm thinking this is a glib2 problem.

gmessages.h shows this code at near line 192:

#else   /* no varargs macros */
static void
g_error (const gchar *format,
         ...) G_ANALYZER_NORETURN
{
  va_list args;
  va_start (args, format);
  g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, format, args);
  va_end (args);

  for(;;) ;
}

and G_ANALYZER_NORETURN is defined in glib/gmacros.h as

#define G_ANALYZER_NORETURN __attribute__((analyzer_noreturn))

So it does look as though there is a missing semicolon here (and for g_critical same file as well). This code is for the case of "no varargs macros" so could be platform specific.

Compare to this declaration (also in gmessages.h)

GLIB_AVAILABLE_IN_ALL
void g_return_if_fail_warning (const char *log_domain,
                               const char *pretty_function,
                               const char *expression) G_ANALYZER_NORETURN;

I'm building on 10.8.5 with Xcode 5.0.

comment:4 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

I was on 10.8.5 with Xcode 4.6.3. The reporter was on Lion. I can try to test on Lion next.

comment:5 in reply to:  4 ; Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: devans@… added; ryandesign@… removed
Owner: changed from devans@… to ryandesign@…
Port: glib2 added; poppler removed
Summary: poppler @0.24.1: error: expected ';' after top level declaratorglib2 @2.38.0: error: expected ';' after top level declarator

On my Lion machine with Xcode 4.3.3 and Apple clang version 3.1 (tags/Apple/clang-318.0.61) (based on LLVM 3.1svn) (deliberately old to test for such issues...), glib2 itself fails to build with this same error. Carmine, what version of Xcode and clang do you have?

comment:6 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

I can reproduce the problem on Mountain Lion by using macports-clang-2.9 and macports-clang-3.0. macports-clang-3.1 works.

comment:7 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: newclosed

I have blacklisted older clang in r111569 and filed an upstream bug report to see what the correct fix would be.

comment:8 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: closedreopened

Of course that doesn't fix poppler...

comment:9 Changed 11 years ago by su-v

Cc: suv-sf@… added

Cc Me!

comment:10 Changed 11 years ago by su-v

OS X 10.7.5, Xcode 4.3.2: same failure

GLib 2.38.0 built successfully for me with attached patch - it reverts this revision (which was based on Bug 700268 - Add support for using the clang analyzer). I can't tell if reverting that one commit is a valid workaround or potentially harmful - at least that commit seems to be the only problem preventing GLib 2.38.0 from compiling with older Apple clang versions.

Last edited 11 years ago by su-v (previous) (diff)

Changed 11 years ago by su-v

Attachment: patch-revert-409a6db3.diff added

comment:11 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Thanks but I'd like to wait to hear back from the developers of glib for the correct solution. Until then, you should upgrade to Xcode 4.6.3 plus its command line tools.

comment:12 in reply to:  8 Changed 11 years ago by dbevans (David B. Evans)

Replying to ryandesign@…:

Of course that doesn't fix poppler...

But looks like there is nothing to fix in poppler.

comment:13 in reply to:  11 ; Changed 11 years ago by dbevans (David B. Evans)

Replying to ryandesign@…:

Thanks but I'd like to wait to hear back from the developers of glib for the correct solution. Until then, you should upgrade to Xcode 4.6.3 plus its command line tools.

This revision seems to be the heart of the matter but instead of reverting I would just add semicolons at the end of the function declarations for g_error and g_critical.

comment:14 in reply to:  13 ; Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to devans@…:

But looks like there is nothing to fix in poppler.

Blacklisting old clang, like I did in the glib2 port, would presumably work around it, but I agree that seems suboptimal, since we'd have to do it in every port that uses gmessages.h.

Replying to devans@…:

This revision seems to be the heart of the matter but instead of reverting I would just add semicolons at the end of the function declarations for g_error and g_critical.

Where, exactly? I don't think the error message is suggesting a reasonable solution. Adding semicolons where it says it expects them does not result in successful compilation.

I am reconsidering using a patch like the one suv suggested, since all that the original patch was supposed to do was add support for developers who want to use the clang analyzer; removing that again isn't something that should affect regular users.

comment:15 in reply to:  5 ; Changed 11 years ago by carmine.ventre@…

Replying to ryandesign@…:

On my Lion machine with Xcode 4.3.3 and Apple clang version 3.1 (tags/Apple/clang-318.0.61) (based on LLVM 3.1svn) (deliberately old to test for such issues...), glib2 itself fails to build with this same error. Carmine, what version of Xcode and clang do you have?

I have Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn) and Xcode Version 4.6.3 (4H1503).

comment:16 in reply to:  15 ; Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to carmine.ventre@…:

I have Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn) and Xcode Version 4.6.3 (4H1503).

That version of clang is old. Please update your command line tools.

comment:17 in reply to:  14 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: reopenedclosed

Replying to ryandesign@…:

I am reconsidering using a patch like the one suv suggested, since all that the original patch was supposed to do was add support for developers who want to use the clang analyzer; removing that again isn't something that should affect regular users.

r111575

comment:18 Changed 11 years ago by cooljeanius (Eric Gallager)

Cc: egall@… added

Cc Me!

comment:19 in reply to:  16 Changed 11 years ago by carmine.ventre@…

Replying to ryandesign@…:

Replying to carmine.ventre@…:

I have Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn) and Xcode Version 4.6.3 (4H1503).

That version of clang is old. Please update your command line tools.

Many thanks! Sorted now.

Note: See TracTickets for help on using tickets.