Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#50139 closed defect (fixed)

mesa @11.1 won't build on Mac OS X 10.6.8, Snow Leopard, because of use of strndup

Reported by: ballapete (Peter Dyballa) Owned by: jeremyhu (Jeremy Huddleston Sequoia)
Priority: Normal Milestone:
Component: ports Version: 2.3.4
Keywords: Cc: jeremyhu (Jeremy Huddleston Sequoia), larryv (Lawrence Velázquez)
Port: mesa

Description

libtool: compile:  /usr/bin/clang++ -DPACKAGE_NAME=\"Mesa\" -DPACKAGE_TARNAME=\"mesa\" -DPACKAGE_VERSION=\"11.1.0\" "-DPACKAGE_STRING=\"Mesa 11.1.0\"" "-DPACKAGE_BUGREPORT=\"https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa\"" -DPACKAGE_URL=\"\" -DPACKAGE=\"mesa\" -DVERSION=\"11.1.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DYYTEXT_POINTER=1 -DHAVE___BUILTIN_BSWAP32=1 -DHAVE___BUILTIN_BSWAP64=1 -DHAVE___BUILTIN_CLZ=1 -DHAVE___BUILTIN_CLZLL=1 -DHAVE___BUILTIN_CTZ=1 -DHAVE___BUILTIN_EXPECT=1 -DHAVE___BUILTIN_FFS=1 -DHAVE___BUILTIN_FFSLL=1 -DHAVE___BUILTIN_POPCOUNT=1 -DHAVE___BUILTIN_POPCOUNTLL=1 -DHAVE___BUILTIN_UNREACHABLE=1 -DHAVE_FUNC_ATTRIBUTE_CONST=1 -DHAVE_FUNC_ATTRIBUTE_FORMAT=1 -DHAVE_FUNC_ATTRIBUTE_MALLOC=1 -DHAVE_FUNC_ATTRIBUTE_PACKED=1 -DHAVE_FUNC_ATTRIBUTE_PURE=1 -DHAVE_FUNC_ATTRIBUTE_UNUSED=1 -DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT=1 -DHAVE_DLADDR=1 -DHAVE_PTHREAD_PRIO_INHERIT=1 -DHAVE_PTHREAD=1 -DHAVE_SHA1_IN_COMMONCRYPTO=1 -I. -I../../include -I../../src -I../../src/mapi -I../../src/mesa/ -I../../src/gallium/include -I../../src/gallium/auxiliary -I../../src/glsl/glcpp -I../../src/glsl/nir -I../../src/gtest/include -I../../src/glsl/nir -D__STDC_LIMIT_MACROS -DUSE_SSE41 -DNDEBUG -DHAVE_XLOCALE_H -DHAVE_SYS_SYSCTL_H -DHAVE_STRTOF -DHAVE_DLOPEN -DHAVE_POSIX_MEMALIGN -DHAVE_SHA1 -DGLX_USE_APPLEGL -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_ALIAS_UNSUPPORTED -DBUILDING_MESA -DMESA_EGL_NO_X11_HEADERS -fvisibility=hidden -Werror=pointer-arith -Werror=vla -pipe -Os -arch x86_64 -stdlib=libstdc++ -Wall -fno-strict-aliasing -fno-builtin-memcmp -Qunused-arguments -MT link_atomics.lo -MD -MP -MF .deps/link_atomics.Tpo -c link_atomics.cpp  -fno-common -DPIC -o .libs/link_atomics.o
linker.cpp:3479:11: error: use of undeclared identifier 'strndup'; did you mean 'strdup'?
   return strndup(name, name_size);
          ^~~~~~~
          strdup
/usr/include/string.h:116:7: note: 'strdup' declared here
char    *strdup(const char *);
         ^
linker.cpp:3479:25: error: too many arguments to function call, expected 1, have 2
   return strndup(name, name_size);
          ~~~~~~~       ^~~~~~~~~
linker.cpp:3490:11: error: use of undeclared identifier 'strndup'; did you mean 'strdup'?
   return strndup(first_dot+1, strlen(first_dot) - 1);
          ^~~~~~~
          strdup
/usr/include/string.h:116:7: note: 'strdup' declared here
char    *strdup(const char *);
         ^
linker.cpp:3490:32: error: too many arguments to function call, expected 1, have 2
   return strndup(first_dot+1, strlen(first_dot) - 1);
          ~~~~~~~              ^~~~~~~~~~~~~~~~~~~~~
1 warning and 4 errors generated.
make[3]: *** [linker.lo] Error 1
make[3]: *** Waiting for unfinished jobs....

make[3]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_x11_mesa/mesa/work/mesa-11.1.0/src/glsl'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_x11_mesa/mesa/work/mesa-11.1.0/src/glsl'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_x11_mesa/mesa/work/mesa-11.1.0/src'
make: *** [all-recursive] Error 1
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_x11_mesa/mesa/work/mesa-11.1.0'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_x11_mesa/mesa/work/mesa-11.1.0" && /usr/bin/make -j8 -w all 

Snow Leopard does not seem to know strndup (therefore Cairo is bringing its own version: cairo-1.14.6/util/cairo-missing/strndup.c).

Attachments (2)

main.log (312.5 KB) - added by ballapete (Peter Dyballa) 5 years ago.
main.log
main.2.log (497.5 KB) - added by ballapete (Peter Dyballa) 5 years ago.
main.log from Leopard

Download all attachments as: .zip

Change History (7)

Changed 5 years ago by ballapete (Peter Dyballa)

Attachment: main.log added

main.log

comment:1 Changed 5 years ago by ballapete (Peter Dyballa)

On PPC Leopard, Mac OS X 10.5.8, the error is quite similar:

:info:build libtool: compile:  /opt/local/bin/g++-apple-4.2 -DPACKAGE_NAME=\"Mesa\" -DPACKAGE_TARNAME=\"mesa\" -DPACKAGE_VERSION=\"11.1.0\" "-DPACKAGE_STRING=\"Mesa 11.1.0\"" "-DPACKAGE_BUGREPORT=\"https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa\"" -DPACKAGE_URL=\"\" -DPACKAGE=\"mesa\" -DVERSION=\"11.1.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DYYTEXT_POINTER=1 -DHAVE___BUILTIN_BSWAP32=1 -DHAVE___BUILTIN_BSWAP64=1 -DHAVE___BUILTIN_CLZ=1 -DHAVE___BUILTIN_CLZLL=1 -DHAVE___BUILTIN_CTZ=1 -DHAVE___BUILTIN_EXPECT=1 -DHAVE___BUILTIN_FFS=1 -DHAVE___BUILTIN_FFSLL=1 -DHAVE___BUILTIN_POPCOUNT=1 -DHAVE___BUILTIN_POPCOUNTLL=1 -DHAVE_FUNC_ATTRIBUTE_CONST=1 -DHAVE_FUNC_ATTRIBUTE_FLATTEN=1 -DHAVE_FUNC_ATTRIBUTE_FORMAT=1 -DHAVE_FUNC_ATTRIBUTE_MALLOC=1 -DHAVE_FUNC_ATTRIBUTE_PACKED=1 -DHAVE_FUNC_ATTRIBUTE_PURE=1 -DHAVE_FUNC_ATTRIBUTE_UNUSED=1 -DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT=1 -DHAVE_DLADDR=1 -DHAVE_PTHREAD_PRIO_INHERIT=1 -DHAVE_PTHREAD=1 -DHAVE_SHA1_IN_COMMONCRYPTO=1 -I. -I../../include -I../../src -I../../src/mapi -I../../src/mesa/ -I../../src/gallium/include -I../../src/gallium/auxiliary -I../../src/glsl/glcpp -I../../src/glsl/nir -I../../src/gtest/include -I../../src/glsl/nir -D__STDC_LIMIT_MACROS -DNDEBUG -DHAVE_XLOCALE_H -DHAVE_SYS_SYSCTL_H -DHAVE_STRTOF -DHAVE_DLOPEN -DHAVE_SHA1 -DGLX_USE_APPLEGL -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_ALIAS_UNSUPPORTED -DBUILDING_MESA -DMESA_EGL_NO_X11_HEADERS -fvisibility=hidden -Werror=pointer-arith -pipe -Os -arch ppc -Wall -fno-strict-aliasing -fno-builtin-memcmp -MT linker.lo -MD -MP -MF .deps/linker.Tpo -c linker.cpp  -fno-common -DPIC -o .libs/linker.o
:info:build linker.cpp: In function 'char* get_top_level_name(const char*)':
:info:build linker.cpp:3479: error: 'strndup' was not declared in this scope
:info:build linker.cpp: In function 'char* get_var_name(const char*)':
:info:build linker.cpp:3490: error: 'strndup' was not declared in this scope
:info:build make[3]: *** [linker.lo] Error 1
:info:build make[3]: Leaving directory `/opt/local/var/macports/build/_opt_mports_trunk_dports_x11_mesa/mesa/work/mesa-11.1.0/src/glsl'

Changed 5 years ago by ballapete (Peter Dyballa)

Attachment: main.2.log added

main.log from Leopard

comment:2 Changed 5 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Yeah... just need to update the static-strndup.patch

comment:3 Changed 5 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Owner: changed from macports-tickets@… to jeremyhu@…
Status: newassigned

comment:4 Changed 5 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Resolution: fixed
Status: assignedclosed

comment:5 Changed 5 years ago by ballapete (Peter Dyballa)

Yes, it built alright on Snow Leopard.

Note: See TracTickets for help on using tickets.