Skip to content

MacOS building of 4.0.0/master #243

@Tieske

Description

@Tieske

When building the current master, I need to specify an additional flag, -std=c++20. So this makes the build succeed; luarocks make CFLAGS="-std=c++20 -O2 -fPIC".

However there are a bunch of warnings in src/intercopycontext.cpp, see details below.

Thijss-MacBook-Pro:lanes thijs$ luarocks make CFLAGS="-std=c++20 -O2 -fPIC"


lanes 4.0.0-0 depends on lua >= 5.1 (5.4-1 provided by VM: success)
env MACOSX_DEPLOYMENT_TARGET=11.0 gcc -std=c++20 -O2 -fPIC -I/usr/local/opt/lua/include/lua5.4 -c src/_pch.cpp -o src/_pch.o -Isrc
env MACOSX_DEPLOYMENT_TARGET=11.0 gcc -std=c++20 -O2 -fPIC -I/usr/local/opt/lua/include/lua5.4 -c src/allocator.cpp -o src/allocator.o -Isrc
env MACOSX_DEPLOYMENT_TARGET=11.0 gcc -std=c++20 -O2 -fPIC -I/usr/local/opt/lua/include/lua5.4 -c src/cancel.cpp -o src/cancel.o -Isrc
env MACOSX_DEPLOYMENT_TARGET=11.0 gcc -std=c++20 -O2 -fPIC -I/usr/local/opt/lua/include/lua5.4 -c src/compat.cpp -o src/compat.o -Isrc
env MACOSX_DEPLOYMENT_TARGET=11.0 gcc -std=c++20 -O2 -fPIC -I/usr/local/opt/lua/include/lua5.4 -c src/deep.cpp -o src/deep.o -Isrc
env MACOSX_DEPLOYMENT_TARGET=11.0 gcc -std=c++20 -O2 -fPIC -I/usr/local/opt/lua/include/lua5.4 -c src/intercopycontext.cpp -o src/intercopycontext.o -Isrc
src/intercopycontext.cpp:479:13: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
  479 |             sprintf(_valPath, "%s." STRINGVIEW_FMT, name.data(), (int) _key.size(), _key.data());
      |             ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_stdio.h:278:1: note: 'sprintf' has been explicitly marked deprecated here
  278 | __deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
      | ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:218:48: note: expanded from macro '__deprecated_msg'
  218 |         #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
      |                                                       ^
src/intercopycontext.cpp:485:13: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
  485 |             sprintf(_valPath, "%s[" LUA_INTEGER_FMT "]", name.data(), key);
      |             ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_stdio.h:278:1: note: 'sprintf' has been explicitly marked deprecated here
  278 | __deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
      | ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:218:48: note: expanded from macro '__deprecated_msg'
  218 |         #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
      |                                                       ^
src/intercopycontext.cpp:491:13: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
  491 |             sprintf(_valPath, "%s[" LUA_NUMBER_FMT "]", name.data(), key);
      |             ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_stdio.h:278:1: note: 'sprintf' has been explicitly marked deprecated here
  278 | __deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
      | ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:218:48: note: expanded from macro '__deprecated_msg'
  218 |         #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
      |                                                       ^
src/intercopycontext.cpp:495:13: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
  495 |             sprintf(_valPath, "%s[U:%p]", name.data(), _key);
      |             ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_stdio.h:278:1: note: 'sprintf' has been explicitly marked deprecated here
  278 | __deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
      | ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:218:48: note: expanded from macro '__deprecated_msg'
  218 |         #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
      |                                                       ^
src/intercopycontext.cpp:499:13: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
  499 |             sprintf(_valPath, "%s[%s]", name.data(), _key ? "true" : "false");
      |             ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_stdio.h:278:1: note: 'sprintf' has been explicitly marked deprecated here
  278 | __deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
      | ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:218:48: note: expanded from macro '__deprecated_msg'
  218 |         #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
      |                                                       ^
src/intercopycontext.cpp:1433:13: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
 1433 |             sprintf(_tmpBuf, "arg_%d", _j.value());
      |             ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_stdio.h:278:1: note: 'sprintf' has been explicitly marked deprecated here
  278 | __deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
      | ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:218:48: note: expanded from macro '__deprecated_msg'
  218 |         #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
      |                                                       ^
6 warnings generated.
env MACOSX_DEPLOYMENT_TARGET=11.0 gcc -std=c++20 -O2 -fPIC -I/usr/local/opt/lua/include/lua5.4 -c src/keeper.cpp -o src/keeper.o -Isrc
env MACOSX_DEPLOYMENT_TARGET=11.0 gcc -std=c++20 -O2 -fPIC -I/usr/local/opt/lua/include/lua5.4 -c src/lane.cpp -o src/lane.o -Isrc
env MACOSX_DEPLOYMENT_TARGET=11.0 gcc -std=c++20 -O2 -fPIC -I/usr/local/opt/lua/include/lua5.4 -c src/lanes.cpp -o src/lanes.o -Isrc
env MACOSX_DEPLOYMENT_TARGET=11.0 gcc -std=c++20 -O2 -fPIC -I/usr/local/opt/lua/include/lua5.4 -c src/linda.cpp -o src/linda.o -Isrc
env MACOSX_DEPLOYMENT_TARGET=11.0 gcc -std=c++20 -O2 -fPIC -I/usr/local/opt/lua/include/lua5.4 -c src/lindafactory.cpp -o src/lindafactory.o -Isrc
env MACOSX_DEPLOYMENT_TARGET=11.0 gcc -std=c++20 -O2 -fPIC -I/usr/local/opt/lua/include/lua5.4 -c src/nameof.cpp -o src/nameof.o -Isrc
env MACOSX_DEPLOYMENT_TARGET=11.0 gcc -std=c++20 -O2 -fPIC -I/usr/local/opt/lua/include/lua5.4 -c src/state.cpp -o src/state.o -Isrc
env MACOSX_DEPLOYMENT_TARGET=11.0 gcc -std=c++20 -O2 -fPIC -I/usr/local/opt/lua/include/lua5.4 -c src/threading.cpp -o src/threading.o -Isrc
env MACOSX_DEPLOYMENT_TARGET=11.0 gcc -std=c++20 -O2 -fPIC -I/usr/local/opt/lua/include/lua5.4 -c src/tools.cpp -o src/tools.o -Isrc
env MACOSX_DEPLOYMENT_TARGET=11.0 gcc -std=c++20 -O2 -fPIC -I/usr/local/opt/lua/include/lua5.4 -c src/tracker.cpp -o src/tracker.o -Isrc
env MACOSX_DEPLOYMENT_TARGET=11.0 gcc -std=c++20 -O2 -fPIC -I/usr/local/opt/lua/include/lua5.4 -c src/universe.cpp -o src/universe.o -Isrc
env MACOSX_DEPLOYMENT_TARGET=11.0 gcc  -bundle -undefined dynamic_lookup -all_load -o /var/folders/ct/ml3h388s1f91mhsg4d1xxrgc0000gn/T/luarocks_build-Lanes-4.0.0-0-7838692/lanes_core.so src/_pch.o src/allocator.o src/cancel.o src/compat.o src/deep.o src/intercopycontext.o src/keeper.o src/lane.o src/lanes.o src/linda.o src/lindafactory.o src/nameof.o src/state.o src/threading.o src/tools.o src/tracker.o src/universe.o
lanes 4.0.0-0 is now installed in /Users/thijs/.luarocks (license: MIT/X11)

Missing dependencies for copas 4.8.0-1:
   luasocket >= 2.1, <= 3.0rc1-2 (not installed)
Thijss-MacBook-Pro:lanes thijs$

Running Lua code that uses the resulting binary gets me a crash:

libc++abi: Terminating due to typed operator new being invoked before its static initializer in libcxx has
been executed. This is likely happening in code with -ftyped-cxx-new-delete enabled and statically linking
against libc++abi. If that is the case, and you cannot avoid invoking operator new in a static initializer,
please try disabling TMO for that code with -fno-typed-cxx-new-delete. Otherwise, please file a bug report
against libc++.
Abort trap: 6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions