From nobody Thu Sep 02 01:35:12 2021 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 337A017A2640 for ; Thu, 2 Sep 2021 01:35:18 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H0Nlm6QWhz4RTZ; Thu, 2 Sep 2021 01:35:16 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mail-pj1-x102a.google.com with SMTP id fz10so327013pjb.0; Wed, 01 Sep 2021 18:35:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:reply-to :content-language:to:cc:from:subject:content-transfer-encoding; bh=QIomoNXTzmDDncHyreN6Q7dVOpWd17/9IhwhpIt6w/0=; b=ZN7WYVw6ddqqIraKleHei70vKYTf8eIvMW81VjCq2KMd702dRonmbqq03RMPczupw3 CVHCWnKnQxE+32UofYAyk1aRaXJjFofBVQci783riMuILEdXdnZKhT63ZEoNlVOZ4MUT 4+YHbfln+ytesP9KCyXGCiBD/T3o478bV+7e2kc9yD0yGAeBm5mCe3ZWQ/BrSolOdJ3g 5lyBKtCL8+lvmUBTT3MqADCm3iRvc9kVq2SKlVGOoBStdfZRlWRfcD+UyxyPtR7ReocX xgxd3KIZJIKQVElpk710Nt6l3Wf22iMwMKcMXt74EgtY5KN3FcIp6ThzPQ3s81nEDp6E SFmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :reply-to:content-language:to:cc:from:subject :content-transfer-encoding; bh=QIomoNXTzmDDncHyreN6Q7dVOpWd17/9IhwhpIt6w/0=; b=aOXfHpFqtK98kKXMxjuk6y0vhFwqu494OfhMjvAgzJFzzYSep5Rnvf8qxKLzcj1i6f HFDuNVPfuB5E3nRorfqlvAQqpQIefHEhoebI4Bomtn2LLgQ77HM3V7TZ1XkTncCDTo5o p5uuYDzhDQa4/bDPV08tanY+3QjDYoBudQ3DJOgPO+G4piKDcDiF4FdTqxk95pVdHadW Zpwyl6/PvmBXZEdc3RmOrUwzY2ITbvI2/oymoSv7iwuWKAP+EM4JoLTIVFuMRkTE73NQ G000hFmYxLhR4b3banC3r/KAKbEKZ1GOFzc+6BH1evNcszl/rFmPH4CwadhyeKLU5svV YbqQ== X-Gm-Message-State: AOAM530bVCIFkMQc2fnBa3Ldo8D6usiagVbZzPVcg3qijUwgi/RzWGBi IrvckeGlAl0wWrvu3SVaV0H5z17ziCbmGg== X-Google-Smtp-Source: ABdhPJyTmehLjIFG7EbHOdq3SsPYD00XhupJxhbxS6cWnXmaBkULx9X6ByW1A0M16VSkLq085W2TcA== X-Received: by 2002:a17:90a:d589:: with SMTP id v9mr842279pju.61.1630546515775; Wed, 01 Sep 2021 18:35:15 -0700 (PDT) Received: from ?IPV6:2403:5800:7500:3601:20b7:4322:3447:eecd? (2403-5800-7500-3601-20b7-4322-3447-eecd.ip6.aussiebb.net. [2403:5800:7500:3601:20b7:4322:3447:eecd]) by smtp.gmail.com with ESMTPSA id x16sm188085pgc.49.2021.09.01.18.35.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 Sep 2021 18:35:15 -0700 (PDT) Message-ID: Date: Thu, 2 Sep 2021 11:35:12 +1000 List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:93.0) Gecko/20100101 Thunderbird/93.0a1 Reply-To: koobs@FreeBSD.org Content-Language: en-US To: FreeBSD Current Cc: Kyle Evans , Alex Richardson From: Kubilay Kocak Subject: linker errors with WITH_UBSAN and WITH_ASAN Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4H0Nlm6QWhz4RTZ X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=ZN7WYVw6; dmarc=none; spf=pass (mx1.freebsd.org: domain of koobsfreebsd@gmail.com designates 2607:f8b0:4864:20::102a as permitted sender) smtp.mailfrom=koobsfreebsd@gmail.com X-Spamd-Result: default: False [-2.39 / 15.00]; HAS_REPLYTO(0.00)[koobs@FreeBSD.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-0.19)[-0.189]; FORGED_SENDER(0.30)[koobs@FreeBSD.org,koobsfreebsd@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; FROM_NEQ_ENVFROM(0.00)[koobs@FreeBSD.org,koobsfreebsd@gmail.com]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::102a:from]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N Hi, I'm seeing the following linker errors when using WITH_UBSAN (without WITH_ASAN) and WITH_ASAN (without WITH_UBSAN), having isolated other variables in src.conf and src-env.conf (attached below): --- ftpd.full --- ld: error: /usr/obj/usr/src/amd64.amd64/tmp/usr/lib/libmd.so: undefined reference to _libmd_SHA256_Transform [--no-allow-shlib-undefined] cc: error: linker command failed with exit code 1 (use -v to see invocation) _ERROR_CMD='cc -target x86_64-unknown-freebsd14.0 --sysroot=/usr/obj/usr/src/amd64.amd64/tmp -B/usr/obj/usr/src/amd64.amd64/tmp/usr/bin -march=sandybridge -mtune=sandybridge -O2 -pipe -fcolor-diagnostics -fno-common -march=sandybridge -DSETPROCTITLE -DLOGIN_CAP -DVIRTUAL_HOSTING -I/usr/src/libexec/ftpd -Dmain=ls_main -I/usr/src/bin/ls -DUSE_BLACKLIST -I/usr/src/contrib/blacklist/include -DINET6 -DUSE_PAM -fPIE -fsanitize=address -fPIC -fsanitize-recover=address -fsanitize=undefined -fsanitize-recover=undefined -g -gz=zlib -std=gnu99 -Wno-format-zero-length -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef -Wno-address-of-packed-member -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter -Qunused-arguments -L/usr/obj/usr/src/amd64.amd64/lib/libblacklist -pie -fsanitize=address -fsanitize=undefined -resource-dir=/usr/obj/usr/src/amd64.amd64/tmp/usr/lib/clang/12.0.1 -Wl,--enable-new-dtags -Wl,-rpath,/usr/lib/ clang/12.0.1/lib/freebsd -o ftpd.full ftpd.o ftpcmd.o logwtmp.o popen.o ls.o cmp.o print.o util.o blacklist.o -lcrypt -lxo -lutil -lopie -lmd -lm -lblacklist -lpam ;' I believe Kyle (cc'd) may have identified the cause of it ("applying __attribute__((optnone)) to SHA256_Transform fixes it") WITH_ASAN (without WITH_UBSAN), fails to link with the following errors: --- all_subdir_usr.bin --- --- all_subdir_usr.bin/clang/lldb --- --- lldb.full --- ld: error: undefined symbol: lldb_private::formatters::CMTimeSummaryProvider(lldb_private::ValueObject&, lldb_private::Stream&, lldb_private::TypeSummaryOptions const&) >>> referenced by memory:1265 (/usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/memory:1265) >>> ObjCLanguage.o:(void std::__1::__call_once_proxy >(void*)) in archive /usr/obj/usr/src/amd64.amd64/lib/clang/liblldb/liblldb.a ld: error: undefined symbol: lldb_private::AppleObjCRuntimeV2::Initialize() >>> referenced by AppleObjCRuntime.cpp:60 (/usr/src/contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp:60) >>> AppleObjCRuntime.o:(lldb_private::lldb_initialize_AppleObjCRuntime()) in archive /usr/obj/usr/src/amd64.amd64/lib/clang/liblldb/liblldb.a >>> referenced by AppleObjCRuntime.cpp:60 (/usr/src/contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp:60) >>> AppleObjCRuntime.o:(lldb_private::AppleObjCRuntime::Initialize()) in archive /usr/obj/usr/src/amd64.amd64/lib/clang/liblldb/liblldb.a ld: error: undefined symbol: lldb_private::AppleObjCRuntimeV1::Initialize() >>> referenced by AppleObjCRuntime.cpp:61 (/usr/src/contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp:61) >>> AppleObjCRuntime.o:(lldb_private::lldb_initialize_AppleObjCRuntime()) in archive /usr/obj/usr/src/amd64.amd64/lib/clang/liblldb/liblldb.a >>> referenced by AppleObjCRuntime.cpp:61 (/usr/src/contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp:61) >>> AppleObjCRuntime.o:(lldb_private::AppleObjCRuntime::Initialize()) in archive /usr/obj/usr/src/amd64.amd64/lib/clang/liblldb/liblldb.a ld: error: undefined symbol: lldb_private::AppleObjCRuntimeV2::Terminate() >>> referenced by AppleObjCRuntime.cpp:65 (/usr/src/contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp:65) >>> AppleObjCRuntime.o:(lldb_private::lldb_terminate_AppleObjCRuntime()) in archive /usr/obj/usr/src/amd64.amd64/lib/clang/liblldb/liblldb.a >>> referenced by AppleObjCRuntime.cpp:65 (/usr/src/contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp:65) >>> AppleObjCRuntime.o:(lldb_private::AppleObjCRuntime::Terminate()) in archive /usr/obj/usr/src/amd64.amd64/lib/clang/liblldb/liblldb.a ld: error: undefined symbol: lldb_private::AppleObjCRuntimeV1::Terminate() >>> referenced by AppleObjCRuntime.cpp:66 (/usr/src/contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp:66) >>> AppleObjCRuntime.o:(lldb_private::lldb_terminate_AppleObjCRuntime()) in archive /usr/obj/usr/src/amd64.amd64/lib/clang/liblldb/liblldb.a >>> referenced by AppleObjCRuntime.cpp:66 (/usr/src/contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp:66) >>> AppleObjCRuntime.o:(lldb_private::AppleObjCRuntime::Terminate()) in archive /usr/obj/usr/src/amd64.amd64/lib/clang/liblldb/liblldb.a ld: error: undefined symbol: lldb_private::CFBasicHash::IsValid() const >>> referenced by NSSet.cpp:570 (/usr/src/contrib/llvm-project/lldb/source/Plugins/Language/ObjC/NSSet.cpp:570) >>> NSSet.o:(lldb_private::formatters::NSCFSetSyntheticFrontEnd::CalculateNumChildren()) in archive /usr/obj/usr/src/amd64.amd64/lib/clang/liblldb/liblldb.a >>> referenced by NSDictionary.cpp:712 (/usr/src/contrib/llvm-project/lldb/source/Plugins/Language/ObjC/NSDictionary.cpp:712) >>> NSDictionary.o:(lldb_private::formatters::NSCFDictionarySyntheticFrontEnd::CalculateNumChildren()) in archive /usr/obj/usr/src/amd64.amd64/lib/clang/liblldb/liblldb.a ld: error: undefined symbol: lldb_private::CFBasicHash::GetCount() const >>> referenced by NSSet.cpp:572 (/usr/src/contrib/llvm-project/lldb/source/Plugins/Language/ObjC/NSSet.cpp:572) >>> NSSet.o:(lldb_private::formatters::NSCFSetSyntheticFrontEnd::CalculateNumChildren()) in archive /usr/obj/usr/src/amd64.amd64/lib/clang/liblldb/liblldb.a >>> referenced by NSSet.cpp:315 (/usr/src/contrib/llvm-project/lldb/source/Plugins/Language/ObjC/NSSet.cpp:315) >>> NSSet.o:(bool lldb_private::formatters::NSSetSummaryProvider(lldb_private::ValueObject&, lldb_private::Stream&, lldb_private::TypeSummaryOptions const&)) in archive /usr/obj/usr/src/amd64.amd64/lib/clang/liblldb/liblldb.a >>> referenced by NSSet.cpp:315 (/usr/src/contrib/llvm-project/lldb/source/Plugins/Language/ObjC/NSSet.cpp:315) >>> NSSet.o:(bool lldb_private::formatters::NSSetSummaryProvider(lldb_private::ValueObject&, lldb_private::Stream&, lldb_private::TypeSummaryOptions const&)) in archive /usr/obj/usr/src/amd64.amd64/lib/clang/liblldb/liblldb.a >>> referenced 3 more times ld: error: undefined symbol: lldb_private::CFBasicHash::Update(unsigned long, lldb_private::ExecutionContextRef) >>> referenced by NSSet.cpp:588 (/usr/src/contrib/llvm-project/lldb/source/Plugins/Language/ObjC/NSSet.cpp:588) >>> NSSet.o:(lldb_private::formatters::NSCFSetSyntheticFrontEnd::Update()) in archive /usr/obj/usr/src/amd64.amd64/lib/clang/liblldb/liblldb.a >>> referenced by NSSet.cpp:313 (/usr/src/contrib/llvm-project/lldb/source/Plugins/Language/ObjC/NSSet.cpp:313) >>> NSSet.o:(bool lldb_private::formatters::NSSetSummaryProvider(lldb_private::ValueObject&, lldb_private::Stream&, lldb_private::TypeSummaryOptions const&)) in archive /usr/obj/usr/src/amd64.amd64/lib/clang/liblldb/liblldb.a >>> referenced by NSSet.cpp:313 (/usr/src/contrib/llvm-project/lldb/source/Plugins/Language/ObjC/NSSet.cpp:313) >>> NSSet.o:(bool lldb_private::formatters::NSSetSummaryProvider(lldb_private::ValueObject&, lldb_private::Stream&, lldb_private::TypeSummaryOptions const&)) in archive /usr/obj/usr/src/amd64.amd64/lib/clang/liblldb/liblldb.a >>> referenced 3 more times ld: error: undefined symbol: lldb_private::CFBasicHash::GetValuePointer() const >>> referenced by NSSet.cpp:598 (/usr/src/contrib/llvm-project/lldb/source/Plugins/Language/ObjC/NSSet.cpp:598) >>> NSSet.o:(lldb_private::formatters::NSCFSetSyntheticFrontEnd::GetChildAtIndex(unsigned long)) in archive /usr/obj/usr/src/amd64.amd64/lib/clang/liblldb/liblldb.a >>> referenced by NSDictionary.cpp:742 (/usr/src/contrib/llvm-project/lldb/source/Plugins/Language/ObjC/NSDictionary.cpp:742) >>> NSDictionary.o:(lldb_private::formatters::NSCFDictionarySyntheticFrontEnd::GetChildAtIndex(unsigned long)) in archive /usr/obj/usr/src/amd64.amd64/lib/clang/liblldb/liblldb.a ld: error: undefined symbol: lldb_private::CFBasicHash::GetKeyPointer() const >>> referenced by NSDictionary.cpp:741 (/usr/src/contrib/llvm-project/lldb/source/Plugins/Language/ObjC/NSDictionary.cpp:741) >>> NSDictionary.o:(lldb_private::formatters::NSCFDictionarySyntheticFrontEnd::GetChildAtIndex(unsigned long)) in archive /usr/obj/usr/src/amd64.amd64/lib/clang/liblldb/liblldb.a ld: error: undefined symbol: lldb_private::lldb_renderscript::fixupX86_64FunctionCalls(llvm::Module&) >>> referenced by RenderScriptExpressionOpts.cpp:109 (/usr/src/contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp:109) >>> RenderScriptExpressionOpts.o:(RenderScriptRuntimeModulePass::runOnModule(llvm::Module&)) in archive /usr/obj/usr/src/amd64.amd64/lib/clang/liblldb/liblldb.a ld: error: undefined symbol: lldb_private::lldb_renderscript::fixupX86FunctionCalls(llvm::Module&) >>> referenced by RenderScriptExpressionOpts.cpp:101 (/usr/src/contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp:101) >>> RenderScriptExpressionOpts.o:(RenderScriptRuntimeModulePass::runOnModule(llvm::Module&)) in archive /usr/obj/usr/src/amd64.amd64/lib/clang/liblldb/liblldb.a --- all_subdir_lib --- Building /usr/obj/usr/src/amd64.amd64/lib/libarchive/tests/test_read_format_cpio_bin_gz.o --- all_subdir_usr.sbin --- Building /usr/obj/usr/src/amd64.amd64/usr.sbin/mld6query/mld6query.full --- all_subdir_usr.bin --- ld: error: undefined symbol: NewCommandObjectRenderScriptScriptGroup(lldb_private::CommandInterpreter&) >>> referenced by RenderScriptRuntime.cpp:4926 (/usr/src/contrib/llvm-project/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp:4926) >>> RenderScriptRuntime.o:(CommandObjectRenderScriptRuntime::CommandObjectRenderScriptRuntime(lldb_private::CommandInterpreter&)) in archive /usr/obj/usr/src/amd64.amd64/lib/clang/liblldb/liblldb.a --- all_subdir_usr.sbin --- Building /usr/obj/usr/src/amd64.amd64/usr.sbin/mld6query/mld6query.debug ============================================= src.conf: MALLOC_PRODUCTION=yes WITHOUT_LLVM_ASSERTIONS=yes WITH_PIE=yes WITH_BIND_NOW=yes WITH_RETPOLINE=yes WITH_SSP=yes WITH_ASAN=yes WITH_UBSAN=yes WITH_CCACHE_BUILD=yes CCACHE_PREFIX=/usr/local/bin/distcc ============================================== src-env.conf: WITH_META_MODE=yes