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)
Change History (12)
Changed 3 years ago by leeeoooooo
| Attachment: | qemu.spice-server.main.log added |
|---|
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 313 313 314 314 # if __APPLE_BAD_MATH_H 315 315 /* These prototypes are incorrectly omitted from <math.h> on Snow Leopard despite being available */ 316 # ifdef __cplusplus 316 317 extern "C" { 318 # endif 317 319 extern long long int llrintl(long double); 318 320 extern long long int llrint(double); 319 321 extern long long int llrintf(float); … … 321 323 extern long long int llroundl(long double); 322 324 extern long long int llround(double); 323 325 extern long long int llroundf(float); 326 # ifdef __cplusplus 324 327 } 328 # endif 325 329 # endif 326 330 #endif // __APPLE__ 327 331
comment:4 follow-up: 5 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 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
comment:8 Changed 16 months ago by aeiouaeiouaeiouaeiouaeiouaeiou
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)
Also affects openexr port on 10.6.8/x86-64, see

spice-server build log