1

I want to build mesa3d source code for some reason. I follow the guide on https://mesa3d.org/install.html and the build environment is fedora31 and gcc9.2, but there are some build error when I trying to build the code with running ninja install.

FAILED: src/mesa/drivers/dri/r200/58cd8d4@@r200@sta/radeon_buffer_objects.c.o cc -Isrc/mesa/drivers/dri/r200/58cd8d4@@r200@sta -Isrc/mesa/drivers/dri/r200 -I../src/mesa/drivers/dri/r200 -Iinclude -I../include -Isrc -I../src -Isrc/mapi -I../src/mapi -Isrc/mesa -I../src/mesa -I../src/gallium/include -Isrc/gallium/auxiliary -I../src/gallium/auxiliary -Isrc/mesa/drivers/dri/common -I../src/mesa/drivers/dri/common -Isrc/util -I../src/util -I../src/mesa/drivers/dri/r200/server -Isrc/util/xmlpool -I/usr/include/libdrm -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c99 -O2 -g -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS '-DPACKAGE_VERSION="20.0.0-devel"' '-DPACKAGE_BUGREPORT="https://gitlab.freedesktop.org/mesa/mesa/issues"' -DUSE_ELF_TLS -DHAVE_ST_VDPAU -DENABLE_ST_OMX_BELLAGIO=0 -DENABLE_ST_OMX_TIZONIA=0 -DHAVE_X11_PLATFORM -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_USE_DRM -DHAVE_DRM_PLATFORM -DHAVE_SURFACELESS_PLATFORM -DENABLE_SHADER_CACHE -DHAVE___BUILTIN_BSWAP32 -DHAVE___BUILTIN_BSWAP64 -DHAVE___BUILTIN_CLZ -DHAVE___BUILTIN_CLZLL -DHAVE___BUILTIN_CTZ -DHAVE___BUILTIN_EXPECT -DHAVE___BUILTIN_FFS -DHAVE___BUILTIN_FFSLL -DHAVE___BUILTIN_POPCOUNT -DHAVE___BUILTIN_POPCOUNTLL -DHAVE___BUILTIN_UNREACHABLE -DHAVE_FUNC_ATTRIBUTE_CONST -DHAVE_FUNC_ATTRIBUTE_FLATTEN -DHAVE_FUNC_ATTRIBUTE_MALLOC -DHAVE_FUNC_ATTRIBUTE_PURE -DHAVE_FUNC_ATTRIBUTE_UNUSED -DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT -DHAVE_FUNC_ATTRIBUTE_WEAK -DHAVE_FUNC_ATTRIBUTE_FORMAT -DHAVE_FUNC_ATTRIBUTE_PACKED -DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL -DHAVE_FUNC_ATTRIBUTE_VISIBILITY -DHAVE_FUNC_ATTRIBUTE_ALIAS -DHAVE_FUNC_ATTRIBUTE_NORETURN -DHAVE_UINT128 -D_GNU_SOURCE -DUSE_SSE41 -DUSE_GCC_ATOMIC_BUILTINS -DUSE_X86_64_ASM -DMAJOR_IN_SYSMACROS -DHAVE_SYS_SYSCTL_H -DHAVE_LINUX_FUTEX_H -DHAVE_ENDIAN_H -DHAVE_DLFCN_H -DHAVE_EXECINFO_H -DHAVE_SYS_SHM_H -DHAVE_CET_H -DHAVE_STRTOF -DHAVE_MKOSTEMP -DHAVE_TIMESPEC_GET -DHAVE_MEMFD_CREATE -DHAVE_RANDOM_R -DHAVE_FLOCK -DHAVE_STRTOK_R -DHAVE_PROGRAM_INVOCATION_NAME -DHAVE_POSIX_MEMALIGN -DHAVE_STRTOD_L -DHAVE_DLADDR -DHAVE_DL_ITERATE_PHDR -DHAVE_ZLIB -DHAVE_PTHREAD -DHAVE_PTHREAD_SETAFFINITY -DHAVE_LIBDRM -DLLVM_AVAILABLE '-DMESA_LLVM_VERSION_STRING="9.0.0"' -DHAVE_VALGRIND -DHAVE_WAYLAND_PLATFORM -DWL_HIDE_DEPRECATED -DHAVE_DRI3 -DHAVE_DRI3_MODIFIERS -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -Werror=empty-body -Werror=incompatible-pointer-types -Wno-missing-field-initializers -Wno-format-truncation -fno-math-errno -fno-trapping-math -Werror=format -Wformat-security -fPIC -fvisibility=hidden -DRADEON_R200 -MD -MQ 'src/mesa/drivers/dri/r200/58cd8d4@@r200@sta/radeon_buffer_objects.c.o' -MF 'src/mesa/drivers/dri/r200/58cd8d4@@r200@sta/radeon_buffer_objects.c.o.d' -o 'src/mesa/drivers/dri/r200/58cd8d4@@r200@sta/radeon_buffer_objects.c.o' -c ../src/mesa/drivers/dri/r200/radeon_buffer_objects.c ../src/mesa/drivers/dri/r200/radeon_buffer_objects.c:1:1: error: expected identifier or '(' before '.' token

1 | ../radeon/radeon_buffer_objects.c
  | ^

Then I check the radeon_buffer_objects.c, and this file just have one file path in it.

../radeon/radeon_buffer_objects.c

I'm not very familier with gcc and clang. What is that mean? And how can I resolve this build error?

Y.L
  • 69
  • 6
  • I'm using WSL on windows, and got the same error in different library when using CRLF instead of LF. Maybe this will help. – paxbun Dec 31 '19 at 04:41
  • 10
    this is a bit out there, but this looks like what happens when you `git clone` a repository on a platform which does not have symlink support (such as windows) – anthony sottile Dec 31 '19 at 04:44
  • 1
    @AnthonySottile my thoughts exactly. Regardless, it’s almost certainly intended to be a symlink. – D. Ben Knoble Dec 31 '19 at 04:47
  • 3
    https://stackoverflow.com/a/42137273/560648 – Lightness Races in Orbit Dec 31 '19 at 04:56
  • @AnthonySottile Thanks! I think this is the root cause. I actually have cloned the repo into windows and update to my own git server because some wired network issue happend. – Y.L Dec 31 '19 at 06:21

1 Answers1

1

As AnthonySottile's comment said, this error is about the symbol link support. I have cloned this repo to windows before and upload to my own git server. And the error occured when I trying to build the source code from my git.

I try to clone the repo from mesa3d.org, and the issue resolved.

Thanks for the help, guys.

Y.L
  • 69
  • 6