Opened 8 years ago

Closed 4 years ago

#51345 closed defect (duplicate)

vlc @2.2.2_4: error: expected identifier or '('

Reported by: dietervdw@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.3.4
Keywords: Cc: RJVB (René Bertin), dbevans (David B. Evans), majoc-at-astro (majoc-at-astro)
Port: VLC

Description (last modified by mf2k (Frank Schima))

:info:build     ../doltcompile /usr/bin/clang -DHAVE_CONFIG_H -I. -I..   -I/opt/local/include -DMODULE_STRING=\"core\" -DLOCALEDIR=\"/opt/local/share/locale\" -DPKGDATADIR=\"/opt/
local/share/vlc\" -DPKGLIBDIR=\"/opt/local/lib/vlc\" -DHAVE_DYNAMIC_PLUGINS  -I../include -I../include -I/opt/local/include -D__unix__=1 -I/opt/local/lib/live/liveMedia/include -I
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_multimedia_VLC/VLC/work/vlc-2.2.2/contrib/include   -pipe -Os -arch x86_64 
-D_INTL_REDIRECT_MACROS -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_multimedia_VLC/VLC/work/vlc-2.2.2/contrib/include
 -Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wmissing-prototypes -Wvolatile-register-var -Werror-implicit-function-declaration -pipe 
-fvisibility=hidden -O3 -ffast-math -funroll-loops -fomit-frame-pointer -MT misc/picture_fifo.lo -MD -MP -MF $depbase.Tpo -c -o misc/picture_fifo.lo misc/picture_fifo.c &&\
:info:build     mv -f $depbase.Tpo $depbase.Plo
:info:build misc/picture.c:43:1: error: expected identifier or '('
:info:build static_assert(sizeof (uintptr_t) == sizeof (atomic_uintptr_t),
:info:build ^

Attachments (1)

main.log (722.0 KB) - added by dietervdw@… 8 years ago.
The main.log file

Download all attachments as: .zip

Change History (13)

Changed 8 years ago by dietervdw@…

Attachment: main.log added

The main.log file

comment:1 Changed 8 years ago by mf2k (Frank Schima)

Port: VLC added; vlc removed

In the future, please use WikiFormatting.

comment:2 Changed 8 years ago by mf2k (Frank Schima)

Description: modified (diff)

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

Cc: rjvbertin@… devans@… added

comment:4 Changed 8 years ago by RJVB (René Bertin)

That's really strange, in my experience I had to patch fewer things in vlc_fixups.h when VLC 2.2.2 was released. Looks like I'm going to have to try building VLC with a clang version that's more recent than Apple clang 602.

Dave: aren't you on 10.11?

Version 0, edited 8 years ago by RJVB (René Bertin) (next)

comment:5 Changed 8 years ago by RJVB (René Bertin)

Here's a patch to apply in port dir VLC, hopefully it'll make the build succeed:

diff --git a/multimedia/VLC/Portfile b/multimedia/VLC/Portfile
index 8e67a2e..1899dcf 100644
--- a/multimedia/VLC/Portfile
+++ b/multimedia/VLC/Portfile
@@ -184,7 +184,9 @@ if {(${subport} eq ${name}) || (${subport} eq "lib${name}")} {
     depends_lib-append  port:lua52
     # depends_lib-append  port:lua
 
-    compiler.blacklist  gcc-4.2 llvm-gcc-4.2 {clang < 300}
+    # VLC doesn't currently build for me using port:clang-3.8
+    compiler.blacklist-append \
+                        gcc-4.2 llvm-gcc-4.2 macports-clang-3.8 {clang < 300}
 
     patchfiles          buildfix-package.mak.patch \
                         configure.ac-no-arch.patch \
@@ -203,6 +205,9 @@ if {(${subport} eq ${name}) || (${subport} eq "lib${name}")} {
                 ${worksrcpath}/modules/access/Makefile.am
         }
     }
+    post-configure {
+        system -W ${worksrcpath} "patch -Np0 -i ${filespath}/patch-static_assert.diff"
+    }
 
     use_autoreconf      yes
     autoreconf.cmd      ./bootstrap
diff --git a/multimedia/VLC/files/patch-static_assert.diff b/multimedia/VLC/files/patch-static_assert.diff
new file mode 100644
index 0000000..f00a7df
--- /dev/null
+++ b/multimedia/VLC/files/patch-static_assert.diff
@@ -0,0 +1,11 @@
+--- config.h.orig    2016-03-22 15:34:33.000000000 +0000
++++ config.h 2016-03-22 15:34:57.000000000 +0000
+@@ -793,6 +793,7 @@
+ /* Define to `int' if <stddef.h> does not define. */
+ /* #undef ssize_t */
+
++#define static_assert _Static_assert
+ #include <vlc_fixups.h>
+
+
+

comment:6 Changed 8 years ago by RJVB (René Bertin)

Dieter: if you're feeling adventurous you could help test-drive the new port version-in-preparation:

https://github.com/RJVB/macstrop/tree/master/multimedia/VLC

(cf. ticket:50697)

comment:7 Changed 8 years ago by dietervdw@…

Wow super impressed with how fast you guys acted on this issue!

I am feeling adventurous yes, bring it on :) .

I am a developer and have a C++ background, so there's that. But not super familiar with the MacPorts build process though, can you give some quick pointers on the MacPorts specifics of how to test-drive this?

comment:8 Changed 8 years ago by RJVB (René Bertin)

Well, in all honesty I should say that we were working on the port anyway, and that a fix already existed for the issue you encountered.

I don't think I have to explain how to get a copy of the files from github. The easiest way to continue will be to:

  • port clean VLC
  • identify where VLC'd port directory lives on your system: port dir VLC
  • replace its contents with the contents from the github link above (or the multimedia/VLC directory from your working copy)
  • repeat the port install command that failed for you

Don't be surprised when you see ffmpeg being built first, the new port uses its own ffmpeg copy. You'll be the first to test this, so apologies if something doesn't work out of the box!

comment:9 Changed 8 years ago by dbevans (David B. Evans)

Sorry for not getting back to you before now, but I've been pulled away on various non-MacPorts issues this week. Yes, I can test on 10.8+ including latest 10.11.

I believe that this ticket refers to the same issue as #50913. My experience is that this error only appears on Yosemite (10.10) when using Xcode 7+.

Your suggested patch doesn't apply cleanly to the current VLC port so perhaps you're using a modified version. But after making the changes manually, I got some very strange results when compiling. I think this has to due with your patching of config.h post-configure which is a bit unconventional. Perhaps it would be better to combine your patch-static_assert.diff with the existing static_assert.patch although I'm not sure how you would do this. Seems like the latter patch is doing the same thing to no avail.

Perhaps it would be best to table this and #50913 for now and push ahead with the new port updates, addressing any outstanding issues there.

comment:10 in reply to:  9 Changed 8 years ago by RJVB (René Bertin)

Replying to devans@…:

I believe that this ticket refers to the same issue as #50913. My experience is that this error only appears on Yosemite (10.10) when using Xcode 7+.

Actually, it also appeared for me on 10.9 when building with port:clang-3.8

Your suggested patch doesn't apply cleanly to the current VLC port so perhaps you're using a modified version. But after making the changes manually, I got some very strange results when compiling. I think this has to due with your patching of config.h post-configure which is a bit unconventional. Perhaps it would be better to combine your patch-static_assert.diff with the existing static_assert.patch although I'm not sure how you would do this. Seems like the latter patch is doing the same thing to no avail.

I didn't notice anything odd or alarming with the patch, but there's another possible fix. IIRC, the static_cast macro is used only in picture.c and it should never fail on OS X. In other words, it should be safe to remove the calls altogether.

Perhaps it would be best to table this and #50913 for now and push ahead with the new port updates, addressing any outstanding issues there.

That's what I'm doing!

comment:11 Changed 8 years ago by majoc-at-astro (majoc-at-astro)

Cc: majoc@… added

Cc Me!

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

Resolution: duplicate
Status: newclosed
Summary: vlc @2.2.2_4 Compile errorvlc @2.2.2_4: error: expected identifier or '('

Duplicate of #50913

Note: See TracTickets for help on using tickets.