@@ -60,5 +60,6 @@ v4l1compat = shared_module('v4l1compat',
name_prefix : '',
install : true,
install_dir : libv4l1privdir,
+ c_args : v4l2_wrapper_args,
dependencies : v4l1compat_deps,
include_directories : v4l2_utils_incdir)
@@ -19,11 +19,6 @@
# Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
*/
-/* ensure we see *64 variants and they aren't transparently used */
-#undef _LARGEFILE_SOURCE
-#undef _FILE_OFFSET_BITS
-#define _LARGEFILE64_SOURCE 1
-
#include <stdlib.h>
#include <stdarg.h>
#include <fcntl.h>
@@ -69,5 +69,6 @@ v4l2convert = shared_module('v4l2convert',
name_prefix : '',
install : true,
install_dir : libv4l2privdir,
+ c_args : v4l2_wrapper_args,
dependencies : v4l2convert_deps,
include_directories : v4l2_utils_incdir)
@@ -23,11 +23,6 @@
/* prevent GCC 4.7 inlining error */
#undef _FORTIFY_SOURCE
-/* ensure we see *64 variants and they aren't transparently used */
-#undef _LARGEFILE_SOURCE
-#undef _FILE_OFFSET_BITS
-#define _LARGEFILE64_SOURCE 1
-
#include <stdarg.h>
#include <stdlib.h>
#include <fcntl.h>
@@ -47,6 +47,16 @@ common_arguments = [
'-include', meson.current_build_dir() / 'config.h',
]
+v4l2_wrapper_args = [
+ # As the library needs to provide both 32-bit and 64-bit versions
+ # of file operations, disable transparent large file support (fixes
+ # 'Error: symbol `open64/mmap64' is already defined' compile failure
+ # otherwise)
+ '-U_FILE_OFFSET_BITS',
+ '-D_FILE_OFFSET_BITS=32',
+ '-D_LARGEFILE64_SOURCE',
+]
+
v4l2_utils_incdir_arr = [
'lib' / 'include',
]
@@ -70,21 +70,10 @@ libv4l2_tracer_incdir = [
v4l2_utils_incdir,
]
-libv4l2_tracer_cpp_args = [
- # Meson enables large file support unconditionally, which redirects file
- # operations to 64-bit versions. This results in some symbols being
- # renamed, for instance open() being renamed to open64(). As the library
- # needs to provide both 32-bit and 64-bit versions of file operations,
- # disable transparent large file support.
- '-U_FILE_OFFSET_BITS',
- '-D_FILE_OFFSET_BITS=32',
- '-D_LARGEFILE64_SOURCE',
-]
-
libv4l2tracer = shared_module('v4l2tracer',
libv4l2tracer_sources,
install : true,
- cpp_args : libv4l2_tracer_cpp_args,
+ cpp_args : v4l2_wrapper_args,
dependencies : libv4l2tracer_deps,
include_directories : libv4l2_tracer_incdir)
Use common meson c_args/cpp_args to disable transparent large file support for the wrappers as already done in utils/v4l2-tracer for lib/libv4l1/v4l1compat.c and lib/libv4l2/v4l2convert.c too. Signed-off-by: Peter Seiderer <ps.report@gmx.net> --- lib/libv4l1/meson.build | 1 + lib/libv4l1/v4l1compat.c | 5 ----- lib/libv4l2/meson.build | 1 + lib/libv4l2/v4l2convert.c | 5 ----- meson.build | 10 ++++++++++ utils/v4l2-tracer/meson.build | 13 +------------ 6 files changed, 13 insertions(+), 22 deletions(-)