Bug 108120

Summary: tools_error2aub-error2aub fails to build: error: implicit declaration of function ‘va_start’
Product: Mesa Reporter: Paul Menzel <pmenzel+bugs.freedesktop.org>
Component: OtherAssignee: mesa-dev
Status: RESOLVED MOVED QA Contact: mesa-dev
Severity: normal    
Priority: medium CC: pmenzel+bugs.freedesktop.org
Version: 18.2   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Paul Menzel 2018-10-02 09:18:45 UTC
I get the error below, building Mesa 18.2.1 with libxcb 1.13.

config.status: executing libtool commands
configure: WARNING: unrecognized options: --enable-texture-float

```
        prefix:          /usr  
        exec_prefix:     /usr  
        libdir:          /usr/lib
        includedir:      /usr/include

        OpenGL:          yes (ES1: yes ES2: yes)

        OSMesa:          libOSMesa

        DRI platform:    drm   
        DRI drivers:     i915 i965 nouveau r200 radeon swrast
        DRI driver dir:  ${libdir}/dri
        GLX:             DRI-based

        EGL:             yes   
        EGL drivers:     builtin:egl_dri2 builtin:egl_dri3
        GBM:             yes   
        EGL/Vulkan/VL platforms:   drm x11 wayland

        Vulkan drivers:  radeon
        Vulkan ICD dir:  ${datarootdir}/vulkan/icd.d

        llvm:            yes   
        llvm-config:     /usr/bin/llvm-config
        llvm-version:    6.0.1 

        Gallium drivers: nouveau r600 radeonsi svga swrast
        Gallium st:      mesa xa xvmc vdpau

        HUD extra stats: no
        HUD lmsensors:   no


        Shared libs:     yes
        Static libs:     no
        Shared-glapi:    yes

        CFLAGS:          -g -O2 -Wall -Werror=implicit-function-declaration -Werror=missing-prototypes -Wmissing-prototypes -Wno-missing-field-initializers -fno-math-errno -fno-trapping-math -std=c99
        CXXFLAGS:        -g -O2 -Wall -fno-math-errno -fno-trapping-math -Wno-missing-field-initializers
        CXX11_CXXFLAGS:
        LDFLAGS:
        Macros:          -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D_GNU_SOURCE -DUSE_SSE41 -DUSE_GCC_ATOMIC_BUILTINS -DNDEBUG -DUSE_X86_64_ASM -DHAVE_SYS_SYSCTL_H -DHAVE_DLFCN_H -DHAVE_STRTOF -DHAVE_MKOSTEMP -DHAVE_TIMESPEC_GET -DHAVE_MEMFD_CREATE -DHAVE_STRTOD_L -DHAVE_DL_ITERATE_PHDR -DHAVE_POSIX_MEMALIGN -DHAVE_ZLIB -DHAVE_LINUX_FUTEX_H -DHAVE_LIBDRM -DGLX_USE_DRM -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_USE_TLS -DHAVE_DRM_PLATFORM -DHAVE_X11_PLATFORM -DHAVE_WAYLAND_PLATFORM -DWL_HIDE_DEPRECATED -DHAVE_DRI3 -DHAVE_DRI3_MODIFIERS -DENABLE_SHADER_CACHE -DHAVE_MINCORE -DHAVE_ST_VDPAU -DHAVE_LLVM=0x0600 -DMESA_LLVM_VERSION_PATCH=1  

        LLVM_CFLAGS:     -I/usr/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
        LLVM_CXXFLAGS:   -I/usr/include -std=c++11 -fno-rtti -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
        LLVM_CPPFLAGS:   -I/usr/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
        LLVM_LDFLAGS:    -L/usr/lib

        PYTHON2:         python2.7

        Run 'make' to build Mesa
[…]


  CC       tools/tools_error2aub-error2aub.o
/dev/shm/bee-root/mesalib/mesalib-18.2.1-0/source/src/intel/tools/aubinator.c: In function ‘e
nsure_phys_mem’:
/dev/shm/bee-root/mesalib/mesalib-18.2.1-0/source/src/intel/tools/aubinator.c:208:11: warning
: unused variable ‘ftruncate_res’ [-Wunused-variable]
       int ftruncate_res = ftruncate(mem_fd, mem_fd_len += 4096);
           ^~~~~~~~~~~~~
/dev/shm/bee-root/mesalib/mesalib-18.2.1-0/source/src/intel/tools/aubinator.c: In function ‘g
et_ggtt_batch_bo’:
/dev/shm/bee-root/mesalib/mesalib-18.2.1-0/source/src/intel/tools/aubinator.c:321:13: warning
: unused variable ‘res’ [-Wunused-variable]
       void *res = mmap((uint8_t *)bo.map + map_offset, 4096, PROT_READ,
             ^~~
/dev/shm/bee-root/mesalib/mesalib-18.2.1-0/source/src/intel/tools/aubinator.c: In function ‘g
et_ppgtt_batch_bo’:
/dev/shm/bee-root/mesalib/mesalib-18.2.1-0/source/src/intel/tools/aubinator.c:382:13: warning
: unused variable ‘res’ [-Wunused-variable]
       void *res = mmap((uint8_t *)bo.map + (page - bo.addr), 4096, PROT_READ,
             ^~~
/dev/shm/bee-root/mesalib/mesalib-18.2.1-0/source/src/intel/tools/error2aub.c: In function ‘fail_if’:
/dev/shm/bee-root/mesalib/mesalib-18.2.1-0/source/src/intel/tools/error2aub.c:46:4: error: implicit declaration of function ‘va_start’; did you mean ‘assert’? [-Werror=implicit-function-declaration]
    va_start(args, format);
    ^~~~~~~~
    assert
/dev/shm/bee-root/mesalib/mesalib-18.2.1-0/source/src/intel/tools/error2aub.c:48:4: error: implicit declaration of function ‘va_end’; did you mean ‘rand’? [-Werror=implicit-function-declaration]
    va_end(args);
    ^~~~~~
    rand
/dev/shm/bee-root/mesalib/mesalib-18.2.1-0/source/src/intel/tools/aubinator_error_decode.c: In function ‘main’:
/dev/shm/bee-root/mesalib/mesalib-18.2.1-0/source/src/intel/tools/aubinator_error_decode.c:759:11: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
       int ret;
           ^~~
/dev/shm/bee-root/mesalib/mesalib-18.2.1-0/source/src/intel/tools/error2aub.c: In function ‘main’:
/dev/shm/bee-root/mesalib/mesalib-18.2.1-0/source/src/intel/tools/error2aub.c:279:13: warning: ‘bo_addr’ may be used uninitialized in this function [-Wmaybe-uninitialized]
             aub_write_trace_block(&aub, AUB_TRACE_TYPE_BATCH,
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                   data, bo_size, bo_addr);
                                   ~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
```
Comment 1 Paul Menzel 2018-10-02 09:21:15 UTC
Here is the first error.

```
/dev/shm/bee-root/mesalib/mesalib-18.2.1-0/source/src/intel/tools/error2aub.c:46:4: error: implicit declaration of function ‘va_start’; did you mean ‘assert’? [-Werror=implicit-function-declaration]
    va_start(args, format);
    ^~~~~~~~
    assert
```
Comment 2 Lionel Landwerlin 2018-10-02 09:30:33 UTC
Sent https://patchwork.freedesktop.org/patch/254342/
Comment 3 Paul Menzel 2018-10-02 09:44:39 UTC
(In reply to Lionel Landwerlin from comment #2)
> Sent https://patchwork.freedesktop.org/patch/254342/

Thanks, I just wanted to upload the same change. Two nitpicks.

1.  Should the include be inserted lexicographically?
2.  I always prefer to have the error message in the commit message.

PS: I am not very involved in Mesa, but isn’t there a build tester, which should have caught that error? (Also, why did nobody else get it?)
Comment 4 Lionel Landwerlin 2018-10-02 10:00:09 UTC
(In reply to Paul Menzel from comment #3)
> (In reply to Lionel Landwerlin from comment #2)
> > Sent https://patchwork.freedesktop.org/patch/254342/
> 
> Thanks, I just wanted to upload the same change. Two nitpicks.
> 
> 1.  Should the include be inserted lexicographically?
> 2.  I always prefer to have the error message in the commit message.
> 
> PS: I am not very involved in Mesa, but isn’t there a build tester, which
> should have caught that error? (Also, why did nobody else get it?)


Feel free to upload a better change, I'll review and push to master.

There are build testers. Not quite sure why it wasn't caught...
The only explanation I could think of is that we have different build option (we usually build a large set of drivers, not just intel ones) and that somehow pulls in a header file already including stdarg.h.
Comment 5 GitLab Migration User 2019-09-18 20:18:57 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/928.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.