Skip to content

Conversation

@tillrohrmann
Copy link

@tillrohrmann tillrohrmann commented Nov 11, 2025

This PR introduces autotools into the sasl2-sys/build.rs to automatically derive the correct toolchain based on HOST and TARGET from CC_<target triplet>, CXX_<target triplet>, AR_<target triplet>.

Additionally, it makes cross compilation possible by not running systest if we are cross compiling.

This fixes #54

By using autotools to configure sasl2, we gain support for cross compilation
because the tool chain is automatically retrieved from CC_<target triplet>.
@tillrohrmann
Copy link
Author

@benesch or @pbor, I would be deeply thankful if you could help me reviewing and merging these changes since we would like to get rid of our rust-sasl fork. Thanks a lot!

@benesch
Copy link
Contributor

benesch commented Nov 12, 2025

Hi @tillrohrmann, thanks for the patch. A few notes though:

  • The decision to not use the autotools crate was intentional. In my experience it causes as many problems as it solves. I would prefer to stick with the current approach of shelling out to configure and make directly.
  • Can you share the exact error you were seeing without the patch? configure itself should handle reading the CC_<target_triple> env var, if I understand correctly.
  • I don't believe the changes to systest should be necessary? When depending upon sasl2-sys as a library, systest should not be linked in or run.

@tillrohrmann
Copy link
Author

tillrohrmann commented Nov 12, 2025

Thanks a lot for getting back to me so quickly @benesch 🙏

Hi @tillrohrmann, thanks for the patch. A few notes though:

  • The decision to not use the autotools crate was intentional. In my experience it causes as many problems as it solves. I would prefer to stick with the current approach of shelling out to configure and make directly.
  • Can you share the exact error you were seeing without the patch? configure itself should handle reading the CC_<target_triple> env var, if I understand correctly.

The problem I am seeing when cross compiling from arm64 to amd64 is:

#15 85.56   = note:  "x86_64-linux-gnu-gcc" "-m64" "/tmp/rustcZVPtj5/symbols.o" "<257 object files omitted>" "-Wl,--as-needed" "-Wl,-Bstatic" "/restate/target/x86_64-unknown-linux-gnu/debug/deps/{libtracing_panic-dfea1c9271554e00,librlimit-12d5a04f1fdb7139,libtikv_jemallocator-5435f8f6a461bed0,librestate_node-ec59f65e0db63fa8,libjemalloc_pprof-ea1c9e3783dbea3c,libtikv_jemalloc_ctl-388ded3ab010b8b4,libmappings-a5d4d548a26816b9,libpprof_util-26150c495c4c456d,libprost-5cf84ba89fc94e6e,librestate_log_server-f93994b0c3543119,librestate_worker-fddc48566f233492,librestate_ingress_kafka-84b7ab8f728e50bc,librdkafka-8975c64f3d09a807,librdkafka_sys-25b8c314874c08db,libnum_enum-25d3298a2dc8657f,libcurl_sys-14a369ff1ee73fbb,libsasl2_sys-4da3fa16190c7a52,libopenssl_sys-cb6e3342ce450978,librestate_metadata_server-ba0da80e10172e68,librestate_metadata_providers-8abb01ca735c371c,libciborium-c22091c6647c1b89,libciborium_ll-2b25ee9f7b08fc60,libciborium_io-b5aacf0845c28597,libconst_format-6c8e453d647fca47,libetcd_client-6e13a0b2a1943698,libaws_sdk_dynamodb-42667bd28ac73b0e,libtracing_slog-814597e4f46e58f8,libraft-20b71abe1d3d3084,libfxhash-253a37b4f88a8ba0,libslog_envlogger-0a2b4a75053c7d46,libslog_stdlog-db548c9e3f61fc01,libslog_scope-478ee35f2f49dc10,libslog_term-140c3d85e3d9632a,libterm-0b25bb198eabf539,libdirs_next-a9446c3048113ae3,libdirs_sys_next-6bb6d8776ecb2932,librand-98834cc018cf9b53,librand_chacha-38454e191673daf7,librand_core-35a55fa8fe3d9e83,libraft_proto-6dd459c507206113,libslog-43374eff1447fa8e,libprotobuf-47992ce471ea7aac,librestate_invoker_impl-e8f152676532e582,librestate_timer_queue-e9f76549c3dba484,librestate_queue-21a19b9f1509f7d1,librestate_fs_util-4c3e1c81120121ff,libasync_channel-6b847ee7a9ab6bc7,libevent_listener_strategy-bf21cd85a73d39a6,libevent_listener-cb7d0845d5cfda10,libparking-bea5d6002b118bbb,libconcurrent_queue-a6acce8b7dc3c063,librestate_timer-82cf465ef38d1062,libpriority_queue-b23cad24990b5ba3,librestate_ingress_http-943214bd05ce9a54,librestate_admin-ed93d712c7a7ff07,libmime_guess-a0b1bf263265fae7,libunicase-ea6e748e2b6dbcfd,librestate_web_ui-1ba317cb5894b110,libinclude_dir-7901666f2a074d80,librestate_wal_protocol-2b7080262e739bfd,librestate_admin_rest_model-b48bc9fd5897a474,libokapi_operation-b6d1e0ddc1dc633b,libokapi-8e641b20090c4891,librestate_storage_query_datafusion-049fc9424baa2ab8,libdatafusion_functions_json-51ca6f231fad1fbb,libjiter-820fd733e4b07bc9,libbitvec-fd7ffaf740871c46,libwyz-3e03c2b138cc014c,libtap-a8c54e2a93513131,libradium-a64cca883d308a8b,libfunty-1dd0464c335a30dd,librestate_service_protocol_v4-74e56bfea96ad196,librestate_service_protocol-308889c0d2e6625d,librestate_partition_store-941f37af8dcbd968,librestate_object_store_util-35e9bf4f2090d20e,librestate_storage_api-0a98b4e32e46ee2d,librangemap-9ebeee0840083a7c,librestate_invoker_api-13e8fd0aabc866e2,librestate_bifrost-29632f1b1b655ebc,libdatafusion-3e89b63a97e3c9e1,libdatafusion_functions_table-b492ae0af9e8914a,libdatafusion_functions_window-b79f753824498716,libdatafusion_physical_optimizer-755ea0cf0fbdbcee,libdatafusion_pruning-ba6dfc960f9cc3b9,libdatafusion_optimizer-52aacc4ca850e0b5,libdatafusion_catalog_listing-9f8127592aa5ad2a,libdatafusion_datasource_json-a6cbc836d810bceb,libdatafusion_datasource_csv-8c30d831de923016,libdatafusion_sql-3f3f4d8b79f86816,libbigdecimal-f409e9e85c4c12e4,libdatafusion_catalog-a378a29dc1daa536,libdatafusion_datasource-afb424d13ff61886,libglob-33575ce8bfb11fe7,libdatafusion_physical_expr_adapter-55defea05d321055,libdatafusion_session-ad52c655665d7efa,libdatafusion_physical_plan-f35e9dc88cba0838,libdatafusion_common_runtime-2b08428483654491,libdatafusion_functions_aggregate-9f8ef32d1110ead9,libdatafusion_physical_expr-d0f5846f58aa0df0,libpetgraph-7b5d5c045b23d4b4,libfixedbitset-8286ef3ce37aa01c,libdatafusion_functions-2ff88afa4d8d9706,libunicode_segmentation-3f3da7097d1ccf8b,libblake3-070c52cb8251c131,libconstant_time_eq-28442bd21fe48b94,libarrayvec-e30c70202009ed7b,libarrayref-774797b04f5affd9,libblake2-0150d862808ecd8e,libdatafusion_execution-80c009274d364c95,libtempfile-59666212fe6fa0ef,librustix-6de06fd9e7218363,liblinux_raw_sys-08fb5a5b578e0761,libdatafusion_expr-7064bd5cc85d56ef,libdatafusion_functions_aggregate_common-f99426f9d85cdd92,libdatafusion_functions_window_common-5327fd60d30daba7,libdatafusion_doc-c2e8f97aa2888629,libdatafusion_physical_expr_common-11ce9318c6697072,libdatafusion_expr_common-bd6118fd4ff8a59d,libdatafusion_common-cd6e8f88b5bd620e,libobject_store-a947292ba64fbd85,libhumantime-de3b85c889f81714,librustls_pemfile-61b3a57bdc6bf384,libquick_xml-16ee0fdb02eb633b,libmd5-ce822bfa4ded443a,libarrow-170eb3f9f2676656,libarrow_row-543eb41bc2376418,libarrow_json-4632a23f2d8f20ea,libsimdutf8-6f430bfaab41822f,libarrow_ipc-6234bc623092efb7,liblz4_flex-1b34d74b0ca400d0,libtwox_hash-841cde4176ce6406,libflatbuffers-1b7658f6bc33ff9b,libarrow_csv-94b478f57d841653,libcsv-d77f2906aef2018f,libcsv_core-e2070b90547121cd,libarrow_string-8a29abfd197ac5e3,libarrow_cast-96d0f9224c7c125f,libatoi-428b65491f161922,libcomfy_table-25f0098076223bc8,libunicode_width-96d84e19f7049815,libstrum-9236e13f3486848f,libcrossterm-c6c9c350e186c94a,liblexical_core-9c204505f7447b83,liblexical_write_float-41e35ba92ed25a90,liblexical_write_integer-66fff32bc109e318,liblexical_parse_float-aa9570642994c320,liblexical_parse_integer-05d394f08a57a5a6,liblexical_util-c37bb5a9486603cc,libarrow_arith-cfda04e75f7b345f,libarrow_ord-f0117b55849c71e2,libarrow_select-d1c85d6258a69b5f,libarrow_array-ca36a4a5e141d48f,libchrono_tz-dc7bcabc764a946f,libphf-3a1520b1f5aef87a,libphf_shared-692a97b69468590e,libsiphasher-d7998c75e48dc4a6,libarrow_data-bb06fb8ffb8f768d,libarrow_schema-1c35a18161af4645,libarrow_buffer-6ea450fd68887c50,libhalf-09f3d5fa7abbdd9c,libsqlparser-077085ba16e42702,librecursive-1a68287bcfa23b73,libstacker-9183a71a509c4fca,libpsm-683766f9438dfb1e,librestate_metadata_server_grpc-55f7199b18d80ae7,librestate_service_client-df587b9453af6986,libbs58-9dbeddb3edb70658,libaws_sdk_lambda-42ecd7092612fb8c,libaws_config-242e82094247a216,libaws_sdk_ssooidc-e86445d99b607821,libaws_sdk_sso-24bac077b26ca9cd,libaws_sdk_sts-4e8f016076860bad,libaws_smithy_query-be4a17cb085317c4,liburlencoding-e7b5c9d4c57b8005,libaws_smithy_xml-6e5d625c92ca207a,libxmlparser-0bd6f431b44727ac,libregex_lite-c45982e039c68377,libaws_runtime-9cb1f031af1f9653,libaws_sigv4-3402588a46b48c96,libaws_smithy_http-077c4e192288a05d,libaws_smithy_eventstream-10abc6501b6164fe,libhmac-d56aed958530b799,libaws_smithy_json-74bbd20dcc74f9f8,libaws_smithy_runtime-0df71efde5cc3cc1,libfastrand-d8b184574d9839fc,libaws_smithy_observability-b035ce35b6421a07,libaws_smithy_http_client-841b2e64e788644d,libhyper_rustls-501f628d3086e7bc,librustls_native_certs-43fc79226060b98a,librustls_pemfile-87c1d98bc810660f,libtokio_rustls-85f271a70170c3e1,librustls-903b37ef85c1243b,libsct-01485994b1605ac1,libwebpki-38b1136768f07faf,libhyper-1ccfdf57c5bda115,libh2-116cdacf42638fbc,libaws_types-dde6d8d38b82fe78,libaws_credential_types-12b9abddbbcdc1a6,libaws_smithy_runtime_api-037477b982808b8a,libaws_smithy_async-a3faa9776398d1c8,libaws_smithy_types-1257112ced385ccf,libbytes_utils-3e7df57ca5d49f03,libhttp_body-573652f8ddf0a068,libhttp-4426d0a08bc802f6,libbase64_simd-9061dfe49ed8b302,librestate_tracing_instrumentation-119241022bb181f5,libtracing_appender-1a796d2de078bb98,libopentelemetry_contrib-6de30083bb929b68,libmetrics_exporter_prometheus-6ffde6550202ee98,libmetrics_util-b76d3cb13d96b20c,libradix_trie-cf7235d9dd71d5c1,libnibble_vec-7eeb5f266c0c0130,libendian_type-802d3145f875ad66,libsketches_ddsketch-a175b7af6b78b5dd,librand_xoshiro-1174c5aea44c1e1c,libordered_float-65f9506eeebc38ab,libquanta-3938e2ba938c3427,libraw_cpuid-624d23ed76c824cd,libopentelemetry_semantic_conventions-4eab20f31f937e35,libopentelemetry_otlp-9c70e77fb7443a2b,libopentelemetry_proto-65acfbce9371dece,libconst_hex-6daa702f494c9345,libopentelemetry_http-6996c2550e1d2d25,libreqwest-9575958dd60cbcc9,librestate_server-1d165cdd860dbbe5,liboctocrab-7e9343b33a8536af,libhyper_rustls-6733285481b7a9e3,libwebpki_roots-a6fd54df95413bc1,libweb_time-1084b2172f8bfa58,libsecrecy-08ff533106a540f2,libjsonwebtoken-6b762d6e16d2c94f,libpem-58423fc167710d6c,libsimple_asn1-a11a49b726da328f,libtime-937e396b22cec982,libnum_threads-5dc93faa4d00983c,libtime_core-2be3de9709e2e941,libnum_conv-d455f83240118bf8,libderanged-03d9af71010fc0a7,libpowerfmt-097727c6ca571117,libbase64-4d31bca543bd493d,liburl-d494b429998e7fe7,libsnafu-0d83d9fbbc8c4d6a,librestate_rocksdb-a36a61b719ab2736,libthreadpool-b1f3da65e5d8cca0,libnum_cpus-3561eeaada7f2277,librust_rocksdb-0992794696fa7f55,librust_librocksdb_sys-0a823d5cb1e0f3c1,libtikv_jemalloc_sys-93a92f52edacb5c2,liblz4_sys-f9e23c297242337f,liblibz_sys-658bd78b5f2801c0,libbzip2_sys-4c76308e75433bc0,librestate_core-b8293da26013631b,libtonic_reflection-ba1030998c6a373e,libassert2-f16edfe2163fec73,libdiff-6f077da94548e3d9,libis_terminal-557aac6d133c3ad5,libtower_http-cae8ffedfc28d4df,libiri_string-5e580e866b15db83,librestate_futures_util-4bfcea02bf8325b7,libopentelemetry_sdk-125a7013ca2288d4,libtracing_opentelemetry-9dcdb3c603f6b234,libtracing_subscriber-858dfa8cbec10530,libtracing_serde-aaea49e63cc353a8,libsharded_slab-351e0495dc271388,libmatchers-7b7de0bc0b85067f,libnu_ansi_term-db2dc386c044b6dc,libthread_local-6724d121ab14a1b6,libtracing_log-7b20950db2050aff,librestate_metadata_store-eb4f589691a77285,libtonic_prost-55c82afc94474fe0,librestate_types-10869f6e9b5b3641,libmetrics-35b6c65be598608b,libbincode-861cb44079ac3dbe,libunty-14f31de1940a7dc6,libjsonschema-ea14f0d08bca6181,libbytecount-6b764a26e783d130,libfraction-f33d14e773cbdf9b,liblazy_static-e1267ac708486087,libnum-41697d8476e1ad76,libnum_iter-a79383e5fcf11192,libnum_rational-1d5ddf43ca5c7cc0,libnum_complex-74f8c8789a197702,libnum_bigint-62cf9b0b3978cc02,libnum_integer-7a83452ce40e66d1,libidna-f154840de68a78be,libidna_adapter-11096f36450a4b0b,libicu_normalizer-1436903855f6e4bf,libicu_normalizer_data-a6448f35ca7da0be,libwrite16-11b2f9be281787c5,libutf8_iter-2824a26a684e817a,libutf16_iter-0ebdace8f81af154,libicu_properties-83fa5c046e34d8ad,libicu_properties_data-5a5143169e64ec04,libicu_locid_transform-952f19cf9efd5696,libicu_locid_transform_data-7a82488e8115019d,libicu_collections-73eb73298b2d74a4,libicu_provider-c8a39a61afcbcdf3,libicu_locid-996d1c02018df6ab,liblitemap-4453b47974b10f55,libtinystr-015e4f977370023b,libzerovec-ca33cc5c2fcd2f16,libwriteable-ef04158df81b649c,libyoke-7ceeccdc990487f6,libzerofrom-ac03f4d326d993c7,libstable_deref_trait-48d0baff9919a880,libuuid_simd-0e6d4fd49faeffaa,liboutref-41b47fc04f62f6ab,libvsimd-6f059c9a0b14b316,libfancy_regex-971cdc80dedb7b75,libbit_set-f792b8332b02b735,libbit_vec-1e47a5ffe4a9b989,libemail_address-51b5f5a19a23644d,libnum_cmp-1859f77157ac1efa,libreferencing-6d0ee021a3bbcb57,libfluent_uri-1ea700f177e3a897,libborrow_or_share-b95d8cf0bc4c359c,libref_cast-dcb13ac83669ae34,libflexbuffers-ec5d489522908633,libnum_enum-bb693a310f3dbb37,libbitflags-77d92efede207d24,libsmartstring-23b3fead73fcc4f4,librestate_base64_util-4f1ab00faa734b14,libregress-28987653ab4d21cc,librestate_errors-9536e420ed43fd62,libtoml-b297dff4a4b3e83a,libtoml_writer-655189ec3b22ca58,libtoml_parser-b2a7d2b584363f45,libserde_spanned-f6fbf79b5ab8c897,libtoml_datetime-656403e625f44837,libhostname-5d847f88b4af4a5c,libprost_types-642bddde2b137055,libsemver-9e24b0e8d8832669,libbase62-eee2bf7e13def858,libtyped_builder-d468b12b0f47c7ef,libderive_builder-51dc737eb8f2dac2,libstatic_assertions-5eb8d3c48a1a85d9,libderive_more-5ded678c9b2b50bf,libdowncast_rs-4185e1af04300412,libchrono-f846dda9e35ac077,libiana_time_zone-6952eba90e6a3cd5,librestate_utoipa-bc0b0d9665008dd5,libregex-3a5333040c0d74a8,libregex_automata-c9c5fd0c14c9d4c2,libaho_corasick-000d9066cee02e5d,libregex_syntax-e46d816d1ac6b61d,libdashmap-4ec7f18a46b2985a,libhashbrown-e988a3dbd51f4994,liblistenfd-904a4953e4d8f712,libmoka-40e7625c492d7b84,libthiserror-0d6fcf27514d46d2,libuuid-8154888ca6294528,libportable_atomic-27df3fd65582f3f2,libtagptr-a7f547b5ebb872c4,libcrossbeam_epoch-6bf1c6c24da69be8,libcrossbeam_channel-e4d1d2b46351b6c6,libcrossbeam_utils-5562a9b0964fa506,libenum_map-04521e729845157c,libxxhash_rust-581dcbf83f1874f9,libitertools-09d0937d1894d7c4,libeither-37cc64da9f214f54,libprost-07c9486e462161ab,libanyhow-340a28775ef87a33,libstrum-a5c0628c31a184e9,libopentelemetry-963342908d1e94ac,libulid-e5b0f25230b33c61,libsha2-37fc40c02fbd8799,libcpufeatures-583c0ab560e7ffcb,libdigest-b7b51fcff5c6bf56,libblock_buffer-c0f35d450e58bb56,libcrypto_common-088305a3e9421841,libgeneric_array-6500d35038604d50,librand-2b91305dd13ee72f,librand_chacha-b0a0c17c10b8068c,libppv_lite86-18798af98c8f5ca6,librand_core-c9e499b2679e0157,libgetrandom-3a5ef4f4dc96b422,libzerocopy-18acb8cfee36e5ff,libtonic-6f3f9a84178d8300,librustls_native_certs-5e78b9d59a5cd3ac,libopenssl_probe-bfa603dd87b3e6e8,libhyper_timeout-a332db8223b7883a,libtokio_rustls-e83be92cc6a83905,libaxum-1e8b233e6b00f673,libserde_path_to_error-39013b777e595514,libserde_urlencoded-3e6d06cdb3b3dffc,libform_urlencoded-d723cf14ca11f5df,libhyper_util-9672101e77b1de17,libpercent_encoding-e68829255a37be98,libipnet-2566494c66045dc1,libsocket2-61a0e26ce81acf1d,libhyper-fcfbf2a4b302143e,libwant-f85810a8a16a173d,libtry_lock-eb28e7c1152acfe5,libhttparse-a75d894eade109fa,libh2-f6336f7301fe12db,libatomic_waker-8c051ed0830db821,libhttpdate-f1997ad51217eea7,libmatchit-de68b9d62c19b50b,libaxum_core-f48337b009fc47cb,libmime-61f8e5eaa065a068,libtower-ea0709374a7dbd57,libtower_layer-9569233dae86857f,libbase64-a6471c2e0b9b2746,libpin_project-4aa4bca22c449abf,libsync_wrapper-31bbe74ba0190e35,libzstd-68375fc445743bb5,libzstd_safe-fae8ab5866924240,libzstd_sys-b6b728860f65523b,libflate2-e3c4634a7dcdbfe1,liblibz_rs_sys-31e5f683b95826e5,libzlib_rs-0193f68363d1e44a,libcrc32fast-20b2eb449f5a0476,libtower_service-0ff7361ca710f48c,libtokio_stream-0d1595ad8ccc136e,libtokio_util-dd1fd7438f823e7b,libhttp_body_util-7a506db80fe87607,libhttp_body-333cc5fb9612485f,libnotify_debouncer_full-efc508d7a436cede,libfile_id-81ff8b45a37811a9,libnotify-be703895e6e34ffc,libwalkdir-8af4ed2665463910,libsame_file-5dd00e006b7a1cf5,libinotify-c199af4d6c204cfd,libinotify_sys-0147a821f615c3c9,libnotify_types-8495bcab6425a80b,libarc_swap-9cad856c75d18902,libgardal-50c1cf25903c3e3d,libfutures-f1afca3284f5f29e,libfutures_executor-1d0387fb57567e8e,libfutures_util-652aaad9ce993f4b,libfutures_io-6c35573d7e92c441,libslab-fc4ace8b7070297a,libfutures_channel-8e1bd8f5393a8535,libfutures_sink-6bdf6ea1374a41e2,libfutures_task-772b080a29842683,libpin_utils-d19e88f8118790fc,libfutures_core-d304bf536afd2c2c,liblikely_stable-66780e8d65184fed,librestate_serde_util-dd8c4a7d8a5a148f,libhttp_serde-a637408d1b8d6eaf,libbytesize-a73714c18db9f7f5,libhttp-70e09928eb288594,libfnv-55699804315cd74d,libfigment-f123fc15a674609c,libtoml-2aaf8d6525657b83,libtoml_edit-ec1ba203842a4f89,libserde_spanned-faf686250cd7ce51,libindexmap-b8623410c79c39c4,libhashbrown-e11e7597b9718a94,libfoldhash-bc3a75144612bc94,libequivalent-61ee4cb029ae1512,liballocator_api2-b851b0e69dee29d5,libwinnow-2825869f0873ab01,libtoml_write-68e8fc44c864087a,libtoml_datetime-7c95d76edb209169,libuncased-7bf7e923252b484c,libpear-675e97c45b1e22ca,libyansi-8691f018d6b2405a,libinlinable_string-24425676b8216cb6,libtokio-750fbf0818f27fe6,libsignal_hook_registry-b530813dfb467502,libsocket2-45a4d7361ef2597b,libbacktrace-b2b2b7dbce3b0f46,libminiz_oxide-b2a76b8ab63d3520,libadler2-28207e02418d786c,libobject-5d7d6799a59b0940,libaddr2line-f60f57b18827f19b,libgimli-0df0607f34f181bb,librustc_demangle-708cc694ee365500,libmio-4f2cbfe3c4a9a7a1,libparking_lot-806fc522388a2278,libparking_lot_core-17e08bd180b59e53,libsmallvec-8bc350de7fb3f781,liblock_api-6e65bd77b63c992b,libscopeguard-d628ce7e2c62c3b2,libahash-4e03e26cf8da6688,libzerocopy-0fd1e677311585b3,libbyteorder-510b231286503f57,libprost_dto-c612ddfd89d4fd18,libtiny_gradient-1687a1115dca6326,liblibm-321e5824e7e9059b,librestate_encoding-51f8563fba7ca904,libbilrost-40e669725b4f3abe,libthin_vec-4c02729a4b395e7a,libbytestring-bdcd72071de53433,libnum_traits-5f7aba240bbc1f30,libgeneric_array-03b0934198d0a011,libtypenum-31f04af531cf28d1,librestate_time_util-e8d9d69ea7501986,libschemars-df534d5c69cf6331,libdyn_clone-13ddf567e3fff777,libindexmap-6fdf352baeca8694,libhashbrown-b43e1dc47e230a03,libbytes-45205ee0141322b6,libthiserror-328a9196cdbaac40,libjiff-622dec75f2d7220e,libserde_with-981d8d22d8a6513d,libserde_json-39c6118ec9de15f2,libmemchr-6bad1c0a63d3d66a,libitoa-a4a4a41511d06edb,libryu-f1cf8cb791882e5a,libhex-43f41b086cc61296,libenumset-4b3708d8eda7f27f,libserde-5bdd39f068105885,libserde_core-98512c4162237d41,libtracing-d4c6a631f8d08c6b,libpin_project_lite-f37712d8470eb551,libtracing_core-8a3b734e1e69525f,libonce_cell-313dd6b68c32577a,librustls-e9c1dc00feae5547,libsubtle-8cf6ccfab0182e3b,libwebpki-026e9b4fb3188ec3,libaws_lc_rs-6611c6668b84a239,libaws_lc_sys-7eb37f345610b901,libring-e9202235cdf66984,libgetrandom-5ef80c552a4c7c4d,liblibc-152ce3c6197bfe72,libuntrusted-5b9d1269aa4be38c,libcfg_if-ffd4b9044c2cd9d5,librustls_pki_types-f38566e51f0288ee,libzeroize-5b3ab5cf4fd743be,liblog-546094c5fff0297c,libcodederror-5e3225381009a555,libclap-135bea7f85fc4c0e,libclap_builder-880f7165c274898b,libterminal_size-dff93d2b4041c91f,librustix-d8d579d243cd2feb,libbitflags-bfc05fafd5a483c9,liblinux_raw_sys-328b6d799c995aef,libstrsim-d647f80c44b8939b,libanstream-59fe44230ab5bad2,libanstyle_query-63b17da3976228e8,libis_terminal_polyfill-d3b9274613ebc07a,libcolorchoice-d615780c06cc5dd3,libanstyle_parse-4c81ce9932f8069e,libutf8parse-75044a70f25224f6,libclap_lex-b182d2ebe19e0abe,libanstyle-63661efccae583e9}.rlib" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib/{libstd-*,libpanic_unwind-*,libobject-*,libmemchr-*,libaddr2line-*,libgimli-*,libcfg_if-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*,liblibc-*,librustc_std_workspace_core-*,liballoc-*,libcore-*,libcompiler_builtins-*}.rlib" "-Wl,-Bdynamic" "-lresolv" "-lstdc++" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-L" "/tmp/rustcZVPtj5/raw-dylibs" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/restate/target/x86_64-unknown-linux-gnu/debug/build/ring-7e0d3fd85f191756/out" "-L" "/restate/target/x86_64-unknown-linux-gnu/debug/build/aws-lc-sys-6ff5b8cc718d6448/out" "-L" "/restate/target/x86_64-unknown-linux-gnu/debug/build/bzip2-sys-8888db809ca5e8ac/out/lib" "-L" "/restate/target/x86_64-unknown-linux-gnu/debug/build/psm-f2a2094036321da4/out" "-L" "/restate/target/x86_64-unknown-linux-gnu/debug/build/libz-sys-a10e8c6f5a3b72f0/out/lib" "-L" "/restate/target/x86_64-unknown-linux-gnu/debug/build/rdkafka-sys-fc31e6b525acd2a8/out/lib" "-L" "/restate/target/x86_64-unknown-linux-gnu/debug/build/curl-sys-d194e995e24a05ac/out/build" "-L" "/restate/target/x86_64-unknown-linux-gnu/debug/build/openssl-sys-d9c053e4ce9cd626/out/openssl-build/install/lib" "-L" "/restate/target/x86_64-unknown-linux-gnu/debug/build/sasl2-sys-61c6e45d9c00cedc/out/install/lib" "-L" "/restate/target/x86_64-unknown-linux-gnu/debug/build/zstd-sys-fef4f739d659b81c/out" "-L" "/restate/target/x86_64-unknown-linux-gnu/debug/build/blake3-7312a4bf6b2ffb03/out" "-L" "/restate/target/x86_64-unknown-linux-gnu/debug/build/rust-librocksdb-sys-2050f32713e12f5e/out" "-L" "/restate/target/x86_64-unknown-linux-gnu/debug/build/lz4-sys-6d0534314fbc3abc/out" "-L" "/restate/target/x86_64-unknown-linux-gnu/debug/build/tikv-jemalloc-sys-b5e9bdd9333fb59a/out/build/lib" "-L" "/restate/target/x86_64-unknown-linux-gnu/debug/build/krb5-src-3abdbe8c56a99731/out/install/lib" "-L" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/restate/target/x86_64-unknown-linux-gnu/debug/deps/restate_server-96f065d5787eaf52" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs"
#15 85.56   = note: some arguments are omitted. use `--verbose` to show all linker arguments
#15 85.56   = note: /usr/lib/gcc-cross/x86_64-linux-gnu/14/../../../../x86_64-linux-gnu/bin/ld: /restate/target/x86_64-unknown-linux-gnu/debug/deps/libsasl2_sys-4da3fa16190c7a52.rlib(client.o): Relocations in generic ELF (EM: 183)
#15 85.56           /usr/lib/gcc-cross/x86_64-linux-gnu/14/../../../../x86_64-linux-gnu/bin/ld: /restate/target/x86_64-unknown-linux-gnu/debug/deps/libsasl2_sys-4da3fa16190c7a52.rlib(client.o): Relocations in generic ELF (EM: 183)
#15 85.56           /usr/lib/gcc-cross/x86_64-linux-gnu/14/../../../../x86_64-linux-gnu/bin/ld: /restate/target/x86_64-unknown-linux-gnu/debug/deps/libsasl2_sys-4da3fa16190c7a52.rlib(client.o): Relocations in generic ELF (EM: 183)
#15 85.56           /usr/lib/gcc-cross/x86_64-linux-gnu/14/../../../../x86_64-linux-gnu/bin/ld: /restate/target/x86_64-unknown-linux-gnu/debug/deps/libsasl2_sys-4da3fa16190c7a52.rlib: error adding symbols: file in wrong format
#15 85.56           collect2: error: ld returned 1 exit status

This looks as if the libsasl2_sys artifacts are built with the wrong architecture.

Note that I am running in an environment with

ENV CC_x86_64_unknown_linux_gnu="sccache x86_64-linux-gnu-gcc"
ENV CXX_x86_64_unknown_linux_gnu="sccache x86_64-linux-gnu-g++"
ENV AR_x86_64_unknown_linux_gnu="x86_64-linux-gnu-ar"
ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER="x86_64-linux-gnu-gcc"
ENV BINDGEN_EXTRA_CLANG_ARGS_x86_64_unknown_linux_gnu="--sysroot=/usr/x86_64-linux-gnu"

With the autotools fix, this problem is gone. I also noticed that you are deriving the CC, AR in the rust-krb5-src repo from CC_<target triplet> and AR_<target triplet> explicitly (https://github.com/MaterializeInc/rust-krb5-src/blob/master/build.rs#L54) which is not happening in this repo. I guess this could also work as a fix if you are trying to avoid introducing autotools.

  • I don't believe the changes to systest should be necessary? When depending upon sasl2-sys as a library, systest should not be linked in or run.

You are right that systest is not needed when only depending on sasl2-sys. I was cross compiling the whole rust-sasl project when running into it. Will remove this part from the PR.

When cross compiling we cannot run tests. Hence, setting ac_cv_gssapi_supports_spnego
to yes to disable them.
@tillrohrmann
Copy link
Author

I've pushed an additional commit which disables tests when cross compiling to improve the user experience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Trouble when cross compiling rust-sasl in vendored mode

2 participants