Opened 3 years ago

Last modified 4 weeks ago

#69159 new defect

doxygen, gromacs, gromacs-plumed, spice-server: error: expected identifier or '('

Reported by: leeeoooooo Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: i386 snowleopard Cc: jeremyhu (Jeremy Huddleston Sequoia), cooljeanius (Eric Gallager), Dave-Allured (Dave Allured)
Port: spice-server, macports-libcxx, clang-11, clang-10, clang-9.0, doxygen, gromacs, gromacs-plumed

Description

I was trying to install QEMU under Mac OS X 10.6.8 on my OG white polycarbonate MacBook1,1 32-bit-ONLY DualCore "Yonah" CPU. One of the dependancies for QEMU is spice-server, but the build failed, apparently due to a syntax error. Please see attached log.

Attachments (1)

qemu.spice-server.main.log (57.2 KB) - added by leeeoooooo 3 years ago.
spice-server build log

Download all attachments as: .zip

Change History (12)

Changed 3 years ago by leeeoooooo

Attachment: qemu.spice-server.main.log added

spice-server build log

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

Keywords: snowleopard added; spice-server qemu removed
Port: QEMU -> removed
Summary: spice-server build failed, unexpected operand…spice-server @0.15.2: error: expected identifier or '('

Something has gone rather wrong when the error is occurring in a compiler header...

:info:build In file included from lines.c:56:
:info:build /opt/local/include/libcxx/v1/math.h:316:8: error: expected identifier or '('
:info:build extern "C" {
:info:build        ^

comment:2 Changed 3 years ago by jmroot (Joshua Root)

It's somehow including a C++ header from C code.

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

Cc: jeremyhu added
Port: macports-libcxx clang-11 clang-10 clang-9.0 added

/opt/local/include/libcxx/v1/math.h is provided by the macports-libcxx port. math.h is supposed to be a C header. The port also helpfully installs a math.h.orig file that helps us see that originally math.h didn't contain the problematic line—which is extern "C" {, since that line can only be used in C++ code.

The macports-libcxx port copies its files from the clang-11 port. The problematic changes are added to the math.h header by this patch:

source:macports-ports/lang/llvm-11/files/3001-Fix-missing-long-long-math-prototypes-when-using-the.patch

The problematic code only takes effect on Mac OS X versions earlier than 10.7.

The problematic patch is also in the clang-10 and clang-9.0 ports.

Is this the fix?

  • math.h

    old new  
    313313
    314314# if __APPLE_BAD_MATH_H
    315315/* These prototypes are incorrectly omitted from <math.h> on Snow Leopard despite being available */
     316#  ifdef __cplusplus
    316317extern "C" {
     318#  endif
    317319    extern long long int llrintl(long double);
    318320    extern long long int llrint(double);
    319321    extern long long int llrintf(float);
     
    321323    extern long long int llroundl(long double);
    322324    extern long long int llround(double);
    323325    extern long long int llroundf(float);
     326#  ifdef __cplusplus
    324327}
     328#  endif
    325329# endif
    326330#endif // __APPLE__
    327331

comment:4 Changed 3 years ago by kencu (Ken)

well, that is weird.

This never has come up since Jeremy wrote this patch up.

Is spice-server using the c++ compiler to compile “c” code?

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

Replying to kencu:

Is spice-server using the c++ compiler to compile “c” code?

If it were, the problem wouldn't occur, since extern "C" is valid in C++.

comment:6 Changed 21 months ago by ryandesign (Ryan Carsten Schmidt)

Port: doxygen gromacs gromacs-plumed added
Summary: spice-server @0.15.2: error: expected identifier or '('doxygen, gromacs, gromacs-plumed, spice-server: error: expected identifier or '('

This problem causes doxygen to fail to build on 10.6 which causes the hundreds of ports that depend on doxygen to fail to build.

https://build.macports.org/builders/ports-10.6_x86_64-builder/builds/222805

https://build.macports.org/builders/ports-10.6_i386-builder/builds/187050

It also affects gromacs and gromacs-plumed (#67363).

comment:7 Changed 16 months ago by bazilio-ua

HI!

Then maybe the person who maintains this port can add the fix from comment 4 to the macports-libcxx port patch? lots of ports on 10.6 are broken that depends on doxygen

https://trac.macports.org/browser/macports-ports/lang/llvm-11/files/3001-Fix-missing-long-long-math-prototypes-when-using-the.patch

comment:8 Changed 16 months ago by aeiouaeiouaeiouaeiouaeiouaeiou

In b9c20ba7e62bafad3aced00d9ef78dbe36aee07b/macports-ports (master):

imlib2: install docs by default only on macOS >=10.7

See: #69159

comment:9 Changed 15 months ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added

comment:10 Changed 15 months ago by Dave-Allured (Dave Allured)

Cc: Dave-Allured added

comment:11 Changed 4 weeks ago by Randrianasulu (Andrew Randrianasulu)

Note: See TracTickets for help on using tickets.