premake-core icon indicating copy to clipboard operation
premake-core copied to clipboard

Build failure on macOS: `sectransp.c: error: ‘TLS_RSA_WITH_3DES_EDE_CBC_SHA’ undeclared here (not in a function)`

Open barracuda156 opened this issue 7 months ago • 4 comments

What seems to be the problem? The build of premake5 fails on macOS 10.6:

/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_premake5/premake5/work/compwrap/cc/usr/bin/gcc-4.2 -Os -arch ppc  -MD -MP -DPREMAKE_COMPRESSION -DPREMAKE_CURL -DLUA_STATICLIB -DNDEBUG -DBUILDING_LIBCURL -DCURL_STATICLIB -DHTTP_ONLY -DUSE_ZLIB -DUSE_SECTRANSP -I../../contrib/curl/lib -I../../contrib/mbedtls/include -I../../contrib/zlib -isystem ../../contrib/curl/include -O3 -w  -o "obj/Release/curl-lib/socketpair.o" -MF "obj/Release/curl-lib/socketpair.d" -c "../../contrib/curl/lib/socketpair.c"
../../contrib/curl/lib/vtls/sectransp.c:166: error: ‘TLS_RSA_WITH_3DES_EDE_CBC_SHA’ undeclared here (not in a function)
../../contrib/curl/lib/vtls/sectransp.c: In function ‘sectransp_cipher_suite_get_str’:
../../contrib/curl/lib/vtls/sectransp.c:815: error: ‘TLS_EMPTY_RENEGOTIATION_INFO_SCSV’ undeclared (first use in this function)
../../contrib/curl/lib/vtls/sectransp.c:815: error: (Each undeclared identifier is reported only once
../../contrib/curl/lib/vtls/sectransp.c:815: error: for each function it appears in.)
../../contrib/curl/lib/vtls/sectransp.c: In function ‘sectransp_cipher_suite_walk_str’:
../../contrib/curl/lib/vtls/sectransp.c:845: error: ‘TLS_EMPTY_RENEGOTIATION_INFO_SCSV’ undeclared (first use in this function)
make[1]: *** [obj/Release/curl-lib/sectransp.o] Error 1

On the buildbot: https://build.macports.org/builders/ports-10.6_x86_64-builder/builds/234115/steps/install-port/logs/stdio

What did you expect to happen? Ideally it should build, since the code appears to support 10.5+: https://github.com/premake/premake-core/blob/903b3aa3e4478bafd176e3beeec3a8a268aaa509/contrib/curl/lib/vtls/sectransp.c#L73-L75 (And of course modern curl works on 10.5+.) If it is broken here beyond repair for some reason, then the build should disable a broken module on affected systems, with an appropriate version threshold.

What have you tried so far? Describe any steps you've taken to try to solve or workaround the bug.

How can we reproduce this? Run the build on 10.6.8, see it fail.

  • [ ] Visual Studio 2022 (vs2022)
  • [ ] Visual Studio 2019 (vs2019)
  • [ ] Visual Studio 2017 (vs2017)
  • [ ] Visual Studio 2015 (vs2015)
  • [ ] Visual Studio 2012 (vs2012)
  • [ ] Visual Studio 2010 (vs2010)
  • [ ] Visual Studio 2008 (vs2008)
  • [ ] Visual Studio 2005 (vs2005)
  • [x] GNU Makefile (gmake)
  • [ ] GNU Makefile Legacy (gmakelegacy)
  • [ ] XCode (xcode)
  • [ ] Codelite
  • [ ] Other (Please list below)

What version of Premake are you using? 5.0.0-beta6_0

Anything else we should know? See also: https://trac.macports.org/ticket/72260

barracuda156 avatar May 17 '25 14:05 barracuda156

It probably should not use securetransport at all, and instead use openssl/gnutls/mbedtls/wolfssl.

The build already uses mbedtls, why not just use that consistently?

barracuda156 avatar May 17 '25 14:05 barracuda156

I have no way to go to 10.6 and verify this bug, given how old the OS is. Are you able to build curl on its own outside of Premake?

nickclark2016 avatar May 23 '25 03:05 nickclark2016

I have no way to go to 10.6 and verify this bug, given how old the OS is. Are you able to build curl on its own outside of Premake?

I think I never tried to build it with securetransport (which is anyway too outdated), since MacPorts defaults to using OpenSSL with it: https://github.com/macports/macports-ports/blob/604f2443c83b8afb0ae490fb797ec7d1fdf125cf/net/curl/Portfile#L257-L259 Curl also builds and works fine with GnuTLS.

I can try with securetransport, just to make sure it also fails outside of Premake (I do not expect this to be Premake-specific issue, though the comment in the source is likely out-of-date).

barracuda156 avatar May 23 '25 03:05 barracuda156

Yes, curl fails to build with securetransport without premake either:

libtool: compile:  /usr/bin/gcc-4.2 -std=gnu99 -DHAVE_CONFIG_H -I../include
-I../lib -I../lib -DBUILDING_LIBCURL -DCURL_STATICLIB -DUNITTESTS -isystem
/opt/local/include -isystem /opt/local/include -pipe -Os
-mmacosx-version-min=10.6 -arch ppc -Werror-implicit-function-declaration
-Wno-system-headers -Wno-shadow -Wno-unreachable-code
-Wno-overlength-strings -Wno-missing-field-initializers -MT
vtls/libcurlu_la-vtls_spack.lo -MD -MP -MF
vtls/.deps/libcurlu_la-vtls_spack.Tpo -c vtls/vtls_spack.c  -fno-common
-DPIC -o vtls/.libs/libcurlu_la-vtls_spack.o
libtool: compile:  /usr/bin/gcc-4.2 -std=gnu99 -DHAVE_CONFIG_H -I../include
-I../lib -I../lib -DBUILDING_LIBCURL -DCURL_STATICLIB -DUNITTESTS -isystem
/opt/local/include -isystem /opt/local/include -pipe -Os
-mmacosx-version-min=10.6 -arch ppc -Werror-implicit-function-declaration
-Wno-system-headers -Wno-shadow -Wno-unreachable-code
-Wno-overlength-strings -Wno-missing-field-initializers -MT
vtls/libcurlu_la-wolfssl.lo -MD -MP -MF vtls/.deps/libcurlu_la-wolfssl.Tpo
-c vtls/wolfssl.c  -fno-common -DPIC -o vtls/.libs/libcurlu_la-wolfssl.o
libtool: compile:  /usr/bin/gcc-4.2 -std=gnu99 -DHAVE_CONFIG_H -I../include
-I../lib -I../lib -DBUILDING_LIBCURL -DCURL_STATICLIB -DUNITTESTS -isystem
/opt/local/include -isystem /opt/local/include -pipe -Os
-mmacosx-version-min=10.6 -arch ppc -Werror-implicit-function-declaration
-Wno-system-headers -Wno-shadow -Wno-unreachable-code
-Wno-overlength-strings -Wno-missing-field-initializers -MT
vtls/libcurlu_la-vtls_spack.lo -MD -MP -MF
vtls/.deps/libcurlu_la-vtls_spack.Tpo -c vtls/vtls_spack.c -o
vtls/libcurlu_la-vtls_spack.o >/dev/null 2>&1
libtool: compile:  /usr/bin/gcc-4.2 -std=gnu99 -DHAVE_CONFIG_H -I../include
-I../lib -I../lib -DBUILDING_LIBCURL -DCURL_STATICLIB -DUNITTESTS -isystem
/opt/local/include -isystem /opt/local/include -pipe -Os
-mmacosx-version-min=10.6 -arch ppc -Werror-implicit-function-declaration
-Wno-system-headers -Wno-shadow -Wno-unreachable-code
-Wno-overlength-strings -Wno-missing-field-initializers -MT
vtls/libcurlu_la-wolfssl.lo -MD -MP -MF vtls/.deps/libcurlu_la-wolfssl.Tpo
-c vtls/wolfssl.c -o vtls/libcurlu_la-wolfssl.o >/dev/null 2>&1
vtls/sectransp.c:172: error: 'TLS_RSA_WITH_3DES_EDE_CBC_SHA' undeclared
here (not in a function)
vtls/sectransp.c: In function 'sectransp_cipher_suite_get_str':
vtls/sectransp.c:816: error: 'TLS_EMPTY_RENEGOTIATION_INFO_SCSV' undeclared
(first use in this function)
vtls/sectransp.c:816: error: (Each undeclared identifier is reported only
once
vtls/sectransp.c:816: error: for each function it appears in.)
vtls/sectransp.c:816: warning: comparison between pointer and integer
vtls/sectransp.c: In function 'sectransp_cipher_suite_walk_str':
vtls/sectransp.c:846: error: 'TLS_EMPTY_RENEGOTIATION_INFO_SCSV' undeclared
(first use in this function)
vtls/sectransp.c:846: warning: assignment makes integer from pointer
without a cast
vtls/sectransp.c: In function 'sectransp_set_default_ciphers':
vtls/sectransp.c:940: warning: format '%d' expects type 'int', but argument
3 has type 'OSStatus'
vtls/sectransp.c: In function 'sectransp_set_selected_ciphers':
vtls/sectransp.c:1008: warning: format '%d' expects type 'int', but
argument 3 has type 'OSStatus'
vtls/sectransp.c: In function 'sectransp_connect_step1':
vtls/sectransp.c:1084: warning: format '%d' expects type 'int', but
argument 3 has type 'OSStatus'
vtls/sectransp.c:1099: error: 'SSLSetALPNProtocols' undeclared (first use
in this function)
vtls/sectransp.c:1099: error: 'SSLCopyALPNProtocols' undeclared (first use
in this function)
vtls/sectransp.c:1114: error: implicit declaration of function
'SSLSetALPNProtocols'
vtls/sectransp.c:1116: warning: format '%d' expects type 'int', but
argument 3 has type 'OSStatus'
vtls/sectransp.c:1185: warning: format '%d' expects type 'int', but
argument 3 has type 'OSStatus'
vtls/sectransp.c:1214: warning: format '%d' expects type 'int', but
argument 4 has type 'OSStatus'
vtls/sectransp.c:1251: warning: format '%d' expects type 'int', but
argument 3 has type 'OSStatus'
vtls/sectransp.c:1260: warning: format '%d' expects type 'int', but
argument 3 has type 'OSStatus'
vtls/sectransp.c:1295: warning: format '%d' expects type 'int', but
argument 3 has type 'OSStatus'
vtls/sectransp.c:1346: warning: format '%d' expects type 'int', but
argument 3 has type 'OSStatus'
vtls/sectransp.c:1365: warning: format '%d' expects type 'int', but
argument 3 has type 'OSStatus'
vtls/sectransp.c:1384: warning: format '%d' expects type 'int', but
argument 3 has type 'OSStatus'
vtls/sectransp.c:1390: warning: format '%d' expects type 'int', but
argument 3 has type 'OSStatus'
vtls/sectransp.c: In function 'verify_cert_buf':
vtls/sectransp.c:1605: warning: format '%d' expects type 'int', but
argument 3 has type 'OSStatus'
vtls/sectransp.c:1612: warning: format '%d' expects type 'int', but
argument 3 has type 'OSStatus'
vtls/sectransp.c:1617: warning: format '%d' expects type 'int', but
argument 3 has type 'OSStatus'
vtls/sectransp.c:1624: warning: format '%d' expects type 'int', but
argument 3 has type 'OSStatus'
vtls/sectransp.c: In function 'sectransp_connect_step2':
vtls/sectransp.c:2038: warning: format '%d' expects type 'int', but
argument 4 has type 'OSStatus'
vtls/sectransp.c:2099: error: 'SSLSetALPNProtocols' undeclared (first use
in this function)
vtls/sectransp.c:2099: error: 'SSLCopyALPNProtocols' undeclared (first use
in this function)
vtls/sectransp.c:2103: error: implicit declaration of function
'SSLCopyALPNProtocols'
vtls/sectransp.c: In function 'sectransp_send':
vtls/sectransp.c:2563: warning: format '%d' expects type 'int', but
argument 3 has type 'OSStatus'
vtls/sectransp.c:2580: warning: format '%d' expects type 'int', but
argument 3 has type 'OSStatus'
vtls/sectransp.c: In function 'sectransp_recv':
vtls/sectransp.c:2641: warning: format '%d' expects type 'int', but
argument 3 has type 'OSStatus'
vtls/sectransp.c: At top level:
vtls/sectransp.c:2695: warning: expected [error|warning|ignored] after
'#pragma GCC diagnostic'
vtls/sectransp.c:2699: warning: expected [error|warning|ignored] after
'#pragma GCC diagnostic'
mv -f vtls/.deps/libcurlu_la-wolfssl.Tpo vtls/.deps/libcurlu_la-wolfssl.Plo
make[2]: *** [vtls/libcurlu_la-sectransp.lo] Error 1

On Fri, May 23, 2025 at 11:45 AM Nick Clark @.***> wrote:

nickclark2016 left a comment (premake/premake-core#2470) https://github.com/premake/premake-core/issues/2470#issuecomment-2903159261

I have no way to go to 10.6 and verify this bug, given how old the OS is. Are you able to build curl on its own outside of Premake?

— Reply to this email directly, view it on GitHub https://github.com/premake/premake-core/issues/2470#issuecomment-2903159261, or unsubscribe https://github.com/notifications/unsubscribe-auth/AV6AXFUDBBGPD44JNXGL6GL272KW3AVCNFSM6AAAAAB5KT4SGGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSMBTGE2TSMRWGE . You are receiving this because you authored the thread.Message ID: @.***>

barracuda156 avatar May 23 '25 06:05 barracuda156