Building on macOS

Hi there,

I am trying to build FoundationDB on macOS 14.4.1 (and on an M2 CPU). In the hope of hitting to less roadblocks, I have disabled most of the bindings (Java, Ruby, and Go). This is the cmake command I used:

cmake -G Ninja -DUSE_CCACHE=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DBUILD_DOCUMENTATION=OFF -DBUILD_RUBY_BINDING=OFF -DBUILD_JAVA_BINDING=OFF -DBUILD_GO_BINDING=OFF -DWITH_ROCKSDB=OFF -B build -S .

Then, to build:

cmake --build build

But, I hit to this error:

[817/1709] Linking CXX shared library lib/libfdb_c.dylib
FAILED: lib/libfdb_c.dylib
: && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -stdlib=libc++ -O3 -DNDEBUG -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -mmacosx-version-min=14.4 -dynamiclib -Wl,-headerpad_max_install_names -gz -Xlinker -no_weak_exports -Xlinker -exported_symbols_list -Xlinker /Users/sepeth/Code/foundationdb/build/bindings/c/fdb_c.symbols -o lib/libfdb_c.dylib -install_name @rpath/libfdb_c.dylib bindings/c/CMakeFiles/fdb_c.dir/fdb_c.cpp.o bindings/c/CMakeFiles/fdb_c.dir/fdb_c.g.S.o  -Wl,-rpath,/opt/homebrew/lib  lib/libfdbclient.a  lib/libfdbrpc.a  lib/libflow.a  lib/libstacktrace.a  /opt/homebrew/lib/libfmt.10.2.1.dylib  lib/libcrc32.a  /opt/homebrew/Cellar/openssl@3/3.3.0/lib/libssl.a  /opt/homebrew/Cellar/openssl@3/3.3.0/lib/libcrypto.a  boost_install/lib/libboost_context.a  boost_install/lib/libboost_filesystem.a  boost_install/lib/libboost_iostreams.a  boost_install/lib/libboost_system.a  boost_install/lib/libboost_serialization.a  -framework IOKit  -framework CoreFoundation  lib/liblibb64.a  lib/libmd5.a  lib/libeio.a && :
ld: building fixups: pointer not aligned at __ZN12LocalityData9keyZoneIdE+0x0 from lib/libfdbrpc.a[22](Locality.cpp.o)
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I am not sure how to proceed. Can you please help me to resolve this issue?

You can work around it by adding -DCMAKE_CXX_FLAGS=-Wl,-ld_classic. The underlying issue goes all the way back to Undefined behaviour analyzer : Member access within misaligned address · Issue #1434 · apple/foundationdb · GitHub, and AFAIK there’s no plan to fix it.

1 Like

Yay, thank you ^-^ Progress!

I see another error now:

[1183/1697] Linking CXX executable bin/fdbserver
FAILED: bin/fdbserver
: && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -Wl,-ld_classic -stdlib=libc++ -O3 -DNDEBUG -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -mmacosx-version-min=14.4 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -gz fdbserver/CMakeFiles/fdbserver.dir/AccumulativeChecksumUtil.cpp.o fdbserver/CMakeFiles/fdbserver.dir/ApplyMetadataMutation.cpp.o fdbserver/CMakeFiles/fdbserver.dir/BackupProgress.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/BackupWorker.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/BlobConnectionProviderTest.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/BlobGranuleServerCommon.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/BlobGranuleValidation.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/BlobManager.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/BlobManifest.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/BlobMigrator.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/BlobRestoreController.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/BlobWorker.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/ClusterController.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/ClusterRecovery.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/CommitProxyServer.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/ConfigBroadcaster.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/ConfigDatabaseUnitTests.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/ConfigFollowerInterface.cpp.o fdbserver/CMakeFiles/fdbserver.dir/ConfigNode.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/ConsistencyScan.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/CoordinatedState.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/Coordination.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/DDRelocationQueue.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/DDShardTracker.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/DDTeamCollection.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/DDTxnProcessor.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/DataDistribution.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/DiskQueue.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/EncryptKeyProxy.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/FDBExecHelper.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/GlobalTagThrottler.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/GrvProxyServer.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/GrvProxyTagThrottler.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/GrvTransactionRateInfo.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/IConfigConsumer.cpp.o fdbserver/CMakeFiles/fdbserver.dir/IKeyValueStore.cpp.o fdbserver/CMakeFiles/fdbserver.dir/IPager.cpp.o fdbserver/CMakeFiles/fdbserver.dir/KeyValueStoreCompressTestData.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/KeyValueStoreMemory.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/KeyValueStoreRocksDB.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/KeyValueStoreSQLite.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/KeyValueStoreShardedRocksDB.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/KnobProtectiveGroups.cpp.o fdbserver/CMakeFiles/fdbserver.dir/LatencyBandConfig.cpp.o fdbserver/CMakeFiles/fdbserver.dir/LatencyBandsMap.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/LeaderElection.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/LocalConfiguration.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/LogRouter.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/LogSystem.cpp.o fdbserver/CMakeFiles/fdbserver.dir/LogSystemConfig.cpp.o fdbserver/CMakeFiles/fdbserver.dir/LogSystemDiskQueueAdapter.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/LogSystemPeekCursor.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/MetricClient.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/MetricLogger.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/MockGlobalState.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/MoveKeys.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/MutationTracking.cpp.o fdbserver/CMakeFiles/fdbserver.dir/OldTLogServer_4_6.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/OldTLogServer_6_0.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/OldTLogServer_6_2.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/OnDemandStore.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/PaxosConfigConsumer.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/QuietDatabase.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/RESTKmsConnector.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/RESTKmsConnectorUtils.cpp.o fdbserver/CMakeFiles/fdbserver.dir/RESTSimKmsVault.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/Ratekeeper.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/RemoteIKeyValueStore.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/ResolutionBalancer.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/Resolver.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/ResolverBug.cpp.o fdbserver/CMakeFiles/fdbserver.dir/RestoreApplier.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/RestoreCommon.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/RestoreController.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/RestoreLoader.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/RestoreRoleCommon.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/RestoreUtil.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/RestoreWorker.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/RestoreWorkerInterface.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/RkTagThrottleCollection.cpp.o fdbserver/CMakeFiles/fdbserver.dir/RocksDBCheckpointUtils.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/RocksDBLogForwarder.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/RoleLineage.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/ServerCheckpoint.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/ServerThroughputTracker.cpp.o fdbserver/CMakeFiles/fdbserver.dir/ShardsAffectedByTeamFailure.cpp.o fdbserver/CMakeFiles/fdbserver.dir/SigStack.cpp.o fdbserver/CMakeFiles/fdbserver.dir/SimKmsConnector.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/SimpleConfigConsumer.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/SimulatedCluster.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/SkipList.cpp.o fdbserver/CMakeFiles/fdbserver.dir/Status.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/StorageCache.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/StorageMetrics.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/StorageServerUtils.cpp.o fdbserver/CMakeFiles/fdbserver.dir/TCInfo.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/TLogServer.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/TSSMappingUtil.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/TagPartitionedLogSystem.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/TagThrottler.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/TenantCache.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/TransactionTagCounter.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/VFSAsync.cpp.o fdbserver/CMakeFiles/fdbserver.dir/VersionedBTree.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/VersionedBTreeDebug.cpp.o fdbserver/CMakeFiles/fdbserver.dir/WaitFailure.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/fdbserver.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/masterserver.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/networktest.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/pubsub.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/storageserver.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/tester.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/worker.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/ApiCorrectness.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/ApiWorkload.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/AsyncFile.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/AsyncFileCorrectness.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/AsyncFileRead.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/AsyncFileWrite.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/AtomicOps.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/AtomicOpsApiCorrectness.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/AtomicRestore.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/AtomicSwitchover.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/AuthzSecurity.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/AutomaticIdempotencyWorkload.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/BackgroundSelectors.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/BackupAndParallelRestoreCorrectness.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/BackupCorrectness.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/BackupToBlob.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/BackupToDBAbort.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/BackupToDBCorrectness.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/BackupToDBUpgrade.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/BlobFailureInjection.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/BlobGranuleCorrectnessWorkload.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/BlobGranuleMergeBoundariesWorkload.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/BlobGranuleRangesWorkload.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/BlobGranuleVerifier.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/BlobRestoreWorkload.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/BulkLoad.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/BulkLoadWithTenants.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/Cache.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/ChangeConfig.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/ChangeFeedOperations.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/ChangeFeeds.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/ClearSingleRange.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/ClientTransactionProfileCorrectness.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/ClientWorkload.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/ClogSingleConnection.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/ClogTlog.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/CommitBugCheck.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/ConfigIncrement.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/ConfigureDatabase.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/ConflictRange.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/ConsistencyCheck.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/ConsistencyCheckUrgent.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/CpuProfiler.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/CreateTenant.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/Cycle.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/DDBalance.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/DDMetrics.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/DDMetricsExclude.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/DataDistributionMetrics.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/DataLossRecovery.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/DcLag.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/DifferentClustersSameRV.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/DiskDurability.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/DiskDurabilityTest.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/DiskFailureInjection.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/DummyWorkload.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/EncryptKeyProxyTest.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/EncryptionOps.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/ExcludeIncludeStorageServersWorkload.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/ExpectStableThroughput.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/ExternalWorkload.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/FailoverWithSSLag.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/FastTriggeredWatches.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/FileSystem.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/FuzzApiCorrectness.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/GcGenerations.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/GetEstimatedRangeSize.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/GetMappedRange.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/GetRangeStream.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/HTTPKeyValueStore.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/HealthMetricsApi.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/HighContentionPrefixAllocatorWorkload.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/IDDTxnProcessorApiCorrectness.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/Increment.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/IncrementalBackup.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/IndexScan.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/Inventory.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/KVStoreTest.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/KillRegion.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/LeakTLogInterface.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/LocalRatekeeper.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/LockDatabase.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/LockDatabaseFrequently.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/LogMetrics.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/LowLatency.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/MachineAttrition.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/Mako.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/MemoryKeyValueStore.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/MemoryLifetime.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/MetaclusterManagementConcurrencyWorkload.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/MetaclusterManagementWorkload.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/MetaclusterRestoreWorkload.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/MetricLogging.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/MiniCycle.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/MockDDReadWrite.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/MockDDTest.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/MockDDTrackerShardEvaluator.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/MutationLogReaderCorrectness.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/ParallelRestore.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/Performance.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/PerpetualWiggleStatsWorkload.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/PerpetualWiggleStorageMigrationWorkload.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/PhysicalShardMove.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/Ping.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/PrivateEndpoints.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/ProtocolVersion.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/PubSubMultiples.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/QueuePush.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/RYWDisable.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/RYWPerformance.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/RandomClogging.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/RandomMoveKeys.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/RandomSelector.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/RawTenantAccessWorkload.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/ReadAfterWrite.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/ReadHotDetection.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/ReadWrite.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/RemoveServersSafely.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/ReportConflictingKeys.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/ResolverBug.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/RestoreBackup.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/RestoreFromBlob.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/RestoreMultiRanges.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/Rollback.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/RyowCorrectness.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/SaveAndKill.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/SelectorCorrectness.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/Serializability.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/Sideband.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/SidebandSingle.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/SimpleAtomicAdd.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/SkewedReadWrite.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/SlowTaskWorkload.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/SnapTest.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/SpecialKeySpaceCorrectness.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/SpecialKeySpaceRobustness.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/StatusWorkload.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/StorageCorruption.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/StorageQuota.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/StorageServerCheckpointRestoreTest.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/Storefront.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/StreamingRangeRead.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/StreamingRead.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/SubmitBackup.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/SuspendProcesses.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/TagThrottleApi.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/TargetedKill.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/TaskBucketCorrectness.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/TenantCapacityLimits.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/TenantEntryCacheWorkload.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/TenantLock.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/TenantManagementConcurrencyWorkload.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/TenantManagementWorkload.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/ThreadSafety.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/Throttling.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/Throughput.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/ThroughputQuota.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/TimeKeeperCorrectness.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/TransactionCost.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/TriggerRecovery.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/UDPWorkload.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/UnitPerf.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/UnitTests.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/Unreadable.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/ValidateStorage.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/VersionStamp.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/WatchAndWait.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/Watches.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/WatchesSameKeyCorrectness.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/WorkerErrors.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/WriteBandwidth.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/WriteDuringRead.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/WriteTagThrottling.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/workloads/workloads.actor.g.cpp.o fdbserver/CMakeFiles/fdbserver.dir/coroimpl/CoroFlow.actor.g.cpp.o -o bin/fdbserver -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/lib/swift -Wl,-rpath,/opt/homebrew/lib  lib/libfdbclient.a  lib/libmetacluster.a  lib/libsqlite.a  lib/libfdbclient.a  lib/libfdbrpc.a  lib/libflow.a  lib/libstacktrace.a  /opt/homebrew/lib/libfmt.10.2.1.dylib  lib/libcrc32.a  /opt/homebrew/Cellar/openssl@3/3.3.0/lib/libssl.a  /opt/homebrew/Cellar/openssl@3/3.3.0/lib/libcrypto.a  boost_install/lib/libboost_context.a  boost_install/lib/libboost_filesystem.a  boost_install/lib/libboost_iostreams.a  boost_install/lib/libboost_system.a  boost_install/lib/libboost_serialization.a  -framework IOKit  -framework CoreFoundation  lib/liblibb64.a  lib/libmd5.a  lib/libeio.a && :
Undefined symbols for architecture arm64:
  "boost::filesystem::detail::dir_itr_imp::~dir_itr_imp()", referenced from:
      encryptionAtRestPlaintextMarkerCheck() in tester.actor.g.cpp.o
      boost::filesystem::recursive_directory_iterator::~recursive_directory_iterator() in tester.actor.g.cpp.o
      boost::filesystem::recursive_directory_iterator::recursive_directory_iterator(boost::filesystem::path const&) (.cold.1) in tester.actor.g.cpp.o
  "boost::filesystem::detail::dir_itr_imp::operator delete(void*)", referenced from:
      encryptionAtRestPlaintextMarkerCheck() in tester.actor.g.cpp.o
      boost::filesystem::recursive_directory_iterator::~recursive_directory_iterator() in tester.actor.g.cpp.o
      boost::filesystem::recursive_directory_iterator::recursive_directory_iterator(boost::filesystem::path const&) (.cold.1) in tester.actor.g.cpp.o
  "boost::filesystem::detail::recursive_directory_iterator_construct(boost::filesystem::recursive_directory_iterator&, boost::filesystem::path const&, boost::filesystem::directory_options, boost::system::error_code*)", referenced from:
      boost::filesystem::recursive_directory_iterator::recursive_directory_iterator(boost::filesystem::path const&) in tester.actor.g.cpp.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
[1196/1697] Building CXX object fdbrpc/CMakeFiles/fdbrpc_sampling.dir/CoroTests.cpp.o

Tried bumping boost by hoping that maybe there’s a better arm64 support, but then got this instead:

FAILED: lib/libfdb_c.dylib
: && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -Wl,-ld_classic -stdlib=libc++ -O3 -DNDEBUG -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -mmacosx-version-min=14.4 -dynamiclib -Wl,-headerpad_max_install_names -gz -Xlinker -no_weak_exports -Xlinker -exported_symbols_list -Xlinker /Users/sepeth/Code/foundationdb/build/bindings/c/fdb_c.symbols -o lib/libfdb_c.dylib -install_name @rpath/libfdb_c.dylib bindings/c/CMakeFiles/fdb_c.dir/fdb_c.cpp.o bindings/c/CMakeFiles/fdb_c.dir/fdb_c.g.S.o -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/lib/swift -Wl,-rpath,/opt/homebrew/lib lib/libfdbclient.a lib/libfdbrpc.a lib/libflow.a lib/libzstd.a lib/libstacktrace.a /opt/homebrew/lib/libfmt.10.2.1.dylib lib/libcrc32.a /opt/homebrew/Cellar/openssl@3/3.3.0/lib/libssl.a /opt/homebrew/Cellar/openssl@3/3.3.0/lib/libcrypto.a /opt/homebrew/lib/libboost_context-mt.a /opt/homebrew/lib/libboost_filesystem-mt.a /opt/homebrew/lib/libboost_atomic-mt.a /opt/homebrew/lib/libboost_iostreams-mt.a -lbz2 -llzma -lz -lzstd /opt/homebrew/lib/libboost_serialization-mt.a /opt/homebrew/lib/libboost_system-mt.a -framework IOKit -framework CoreFoundation lib/liblibb64.a lib/libmd5.a lib/libeio.a && :
ld: library not found for -lzstd

Since both are from the linker, maybe ld_classic is not happy with both?

I’ve been just removing the body of the function encryptionAtRestPlaintextMarkerCheck in order to get compilation to work :frowning:, which should be fine unless you’re specifically interested in testing encryption at rest. I think that’s the full set of hacks that gets compilation work for me.

2 Likes

Success ヽ(´▽`)/ Thank you kind sir!

In case someone trying to do the same, I had to make one small change that I forgot to mention before:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1da621f17..92956eb5c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -27,7 +27,7 @@ project(foundationdb
   VERSION 7.4.0
   DESCRIPTION "FoundationDB is a scalable, fault-tolerant, ordered key-value store with full ACID transactions."
   HOMEPAGE_URL "http://www.foundationdb.org/"
-  LANGUAGES C CXX ASM Swift)
+  LANGUAGES C CXX ASM)

Without it, cmake build tree generation fails if swiftc is missing (despite WITH_SWIFT=OFF).

1 Like

Thank you guys, this helped me get a successful compile on my silicon mac!

Fwiw, I didn’t see any of the arm64 linker failures on the latest main checkout, but when I tried on earlier branches like 71.3 release, I see a lot of these errors (not just encryptionAtRestPlaintextMarkerCheck)

1 Like