Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7956 Discussions

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

albl500
Beginner
1,025 Views

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:-

[bash]../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[/bash]

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


[bash]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

[/bash]


During the make stage I get this error:

[bash]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)

[/bash]

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,

Alex

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

0 Kudos
11 Replies
albl500
Beginner
1,025 Views
I've tried adding -fno-builtin to CFLAGS, CPPFLAGS, CXXFLAGS and OBJCFLAGS, but this doesn't make a difference. Please, any suggestions?
0 Kudos
Judith_W_Intel
Employee
1,025 Views

Do you have some code that reproduces the problem?

thanks
Judy
0 Kudos
albl500
Beginner
1,025 Views
Hi, 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. Cheers Alex
0 Kudos
SergeyKostrov
Valued Contributor II
1,025 Views
>>...Can anyone help me solve this??... Could you attach these files? ../include/bits/fcntl2.h ../src/posix/filesystem.c
0 Kudos
albl500
Beginner
1,025 Views
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 (http://packages.debian.org/sid/amd64/libc6-dev/filelist). 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 http://repo.or.cz/w/vlc.git/blob/d787a15aeef5a79e18fdfd8e16118b7c2df37fbf:/src/posix/filesystem.c ). There have been two updates to that file since then [ http://repo.or.cz/w/vlc.git/history/75ae8b8313310c5abc382085f1f0ca18754ef354:/src/posix/filesystem.c ], 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...
0 Kudos
SergeyKostrov
Valued Contributor II
1,025 Views
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.
0 Kudos
albl500
Beginner
1,025 Views
Hi, 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 launchpad.net, 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..) Cheers, Alex
0 Kudos
SergeyKostrov
Valued Contributor II
1,025 Views
>>...Is it possible that fcntl2.h is used directly? You need to check it in ../src/posix/filesystem.c.
0 Kudos
SergeyKostrov
Valued Contributor II
1,025 Views
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." #endif ... Is it possible that fcntl2.h is used directly?
0 Kudos
albl500
Beginner
1,025 Views
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...
0 Kudos
albl500
Beginner
1,025 Views
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...
0 Kudos
Reply