Compiling VLC2.0 with Intel Compiler - invalid use of __builtin_va_arg_pack

Compiling VLC2.0 with Intel Compiler - invalid use of __builtin_va_arg_pack

I'm trying to compile VLC2.0 on Ubuntu 11.10, and am stumped with this error. I've already successfully compiled all of the dependencies in vlc-2.0.0/contrib/, using the latest Intel compiler suite. However, I'm getting an error when compiling (or is it linking?) src/posix/filesystem.c

Configured VLC with:-

../configure  --host="x86_64-linux-gnu"  --build="x86_64-linux-gnu"  --enable-shared --enable-gpl  --enable-version3 --enable-nonfree  --enable-gnutls --enable-libass  --enable-libbluray --enable-libcdio  --enable-libdirac --enable-libfaac  --enable-libfreetype --enable-libmp3lame  --enable-libopenjpeg --enable-libpulse  --enable-librtmp --enable-libschroedinger  --enable-libspeex --enable-libtheora  --enable-libvo-aacenc --enable-libvorbis  --enable-libx264 --enable-libxvid  --enable-openssl --enable-openal

I've edited some of the flags in the makefile; relevant flags are now:

CC = icc -std=gnu99
CFLAGS = -O3 -ipo -I/usr/local/src/vlc-2.0.0/contrib/x86_64-linux-gnu/include -Wall -Wextra -Wsign-compare -Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wmissing-prototypes -Wvolatile-register-var -Werror-implicit-function-declaration -pipe -fvisibility=hidden -funroll-loops -fomit-frame-pointer -finline -finline-limit=1000
CPP = icc -E
CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I/usr/local/src/vlc-2.0.0/contrib/x86_64-linux-gnu/include
CXX = icpc
CXXCPP = icpc -E
CXXFLAGS = -O3 -std=gnu99 -xHost -I/usr/local/src/vlc-2.0.0/contrib/x86_64-linux-gnu/include -Wall -Wextra -Wsign-compare -Wpointer-arith -Wvolatile-register-var -fvisibility=hidden -funroll-loops -fomit-frame-pointer

During the make stage I get this error:

CC posix/filesystem.lo
../../src/posix/filesystem.c(300): warning #589: transfer of control bypasses initialization of: variable "ln" (declared at line 302)
goto error;
^ /usr/include/bits/fcntl2.h(44): error #18015: invalid use of '__builtin_va_arg_pack_len'
/usr/include/bits/fcntl2.h(57): error #18015: invalid use of '__builtin_va_arg_pack_len'
/usr/include/bits/fcntl2.h(60): error #18015: invalid use of '__builtin_va_arg_pack'
/usr/include/bits/fcntl2.h(120): error #18015: invalid use of '__builtin_va_arg_pack_len'
/usr/include/bits/fcntl2.h(133): error #18015: invalid use of '__builtin_va_arg_pack_len'
/usr/include/bits/fcntl2.h(136): error #18015: invalid use of '__builtin_va_arg_pack' compilation aborted for ../../src/posix/filesystem.c (code 1)

Having looked around online, I've seen a couple mail-lists mentioning optimisation flags causing this error with gcc, specifically flags involved with inlining, which is why I added:-
-ipo -finline -finline-limit=1000 to CFLAGS.
This doesn't seem to solve the problem though.

Can anyone help me solve this??

I've tried to figure out the exact compile/libtool command used by the makefile, in order to compile filesystem.lo manually, but I can't find a way to getmaketo print the exact command used, even withmake -d.

I did manage to compile filesystem.c, but it made an ELF 64bit executable, rather than a libtool object file, so I still couldn't get past this step...

Any help much appreciated!

Kind regards,


ps. I've asked this question on stackoverflow, but figured I might get a quicker response here...

12 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I've tried adding -fno-builtin to CFLAGS, CPPFLAGS, CXXFLAGS and OBJCFLAGS, but this doesn't make a difference. Please, any suggestions?

Do you have some code that reproduces the problem?


Sorry I haven't replied until now. Tbh, I haven't been back to this page.. Sorry. The Ubuntu repository's have since updated VLC to version 2.x, so I recently deleted my entire vlc (from git) build tree and installation. I did manage to compile VLC with icc in the end, but can't remember what I did exactly to get it work.. Think I might have been using the '-ipo' option incorrectly.

>>...Can anyone help me solve this??...

Could you attach these files?


These files will blatantly have been updated since I ran that build, in March. fcntl2.h is part of the Debian distribution, and mine was last updated on October 5th. I'm not sure where I could find the source code for this file, for back in March. It is included as part of the libc6-dev-bin package though ( Let me know if you want me to upload the current version I have of that file...

The src/posix/filesystem.c file I had in my system at the time can be found in the vlc git development tree ( at ). There have been two updates to that file since then [ ], so I'm not sure if this has been updated to work now or not.

Tbh, I wouldn't waste your time with this. As I said, I've delete my entire vlc build tree, and don't plan on going through the rigamarole of building vlc and its dependencies again, any time soon. I've also uninstalled Composer XE 2011, and replaced it with Composer XE 2013...

Thanks for the response.

>>...Let me know if you want me to upload the current version I have of that file...

Yes, it would be nice if you upload both files ( your versions, if they still exist ) that produced these compilation errors.

I've had a good browse online for the Debian CVS tree, and the source code for the libc6-dev package I had installed back in March. It would have been from Ubuntu 11.10. As I said above, the version of fcntl2.h currently on my system was last modified this month (October 5th). I'll attach that now, though.. Just found the .deb package file from, which I think would have been the most recent version from March. I just downloaded and extracted it, and a diff shows that this is identical to the 12.04 version of the file I currently have installed.

(Apparently, I can't upload files with a .h extension, so adding .txt to the end..)


Downloadtext/plain fcntl2.h.txt5.48 KB

Thanks for the uploaded header.

>>/usr/include/bits/fcntl2.h(44): error #18015: invalid use of '__builtin_va_arg_pack_len'
>>/usr/include/bits/fcntl2.h(57): error #18015: invalid use of '__builtin_va_arg_pack_len'
>>/usr/include/bits/fcntl2.h(60): error #18015: invalid use of '__builtin_va_arg_pack'
>>/usr/include/bits/fcntl2.h(120): error #18015: invalid use of '__builtin_va_arg_pack_len'
>>/usr/include/bits/fcntl2.h(133): error #18015: invalid use of '__builtin_va_arg_pack_len'
>>/usr/include/bits/fcntl2.h(136): error #18015: invalid use of '__builtin_va_arg_pack'

These two functions in fcntl2.h header file are matched to built-ins:

va_arg_pack_len -> __builtin_va_arg_pack_len
va_arg_pack -> __builtin_va_arg_pack

and it looks OK. However, I found a very important note at the beginning of the header:

#ifndef _FCNTL_H
# error "Never include arrow-left bits/fcntl2.h arrow-right directly; use arrow-left fcntl.h arrow-right instead."

Is it possible that fcntl2.h is used directly?

>>...Is it possible that fcntl2.h is used directly?

You need to check it in ../src/posix/filesystem.c.

I looked in filesystem.c, at the link in my above post, but only <fcntl.h> is included. A similar preprocessor error is also in "bits/fcntl.h", so filesystem.c does seem to use the correct way of including fcntl headers. I'm cloning vlc from git again now. It's a massive build, but I'll see if I can reproduce these errors...

I've just rebuilt vlc (from git) using icc 13.0 from Composer XE 2013, but have been unable to reproduce this error. I got some other errors, but even after reverting filesystem.c back to a version from March, this error is not reproduced. I have been unable to get far in the build when using the '-ipo' option, as `nm` output on object files only produces one symbol, with a name like `__wl_data_included`; libtool then fails to create an exported symbol table. So, somewhere down the line, something was fixed. I don't know where, but I guess this thread can be closed now...

Leave a Comment

Please sign in to add a comment. Not a member? Join today