Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

libclang C API is exporting C++ symbols #42559

Open Quuxplusone opened 5 years ago

Quuxplusone commented 5 years ago
Bugzilla Link PR43589
Status NEW
Importance P release blocker
Reported by Sylvestre Ledru (sylvestre@debian.org)
Reported on 2019-10-07 07:09:56 -0700
Last modified on 2019-10-14 23:23:26 -0700
Version unspecified
Hardware PC Linux
CC chris.bieneman@gmail.com, klimek@google.com, llvm-bugs@lists.llvm.org, mgorny@gentoo.org, richard-llvm@metafoo.co.uk
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
In Debian/Ubuntu packages, I have been maintaining the list of symbols.
https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/blob/9/debian/libclang1-X.Y.symbols.in

Since October 2nd (I don't have the exact revision), in master, the library
also export C++ symbols.

 libclang-10.so.1 libclang1-10 #MINVER#
  (optional)LLVM_10@LLVM_10 1:5.0~svn298832-1~
+ _ZN4llvm10TimeRecord14getCurrentTimeEb@Base 1:10~svn373870-
1~exp1+0~20191006201134.2786~1.gbp2b7b74
+ _ZN4llvm10TimerGroupC1ENS_9StringRefES1_@Base 1:10~svn373870-
1~exp1+0~20191006201134.2786~1.gbp2b7b74
+ _ZN4llvm10TimerGroupD1Ev@Base 1:10~svn373870-
1~exp1+0~20191006201134.2786~1.gbp2b7b74
+ _ZN4llvm10hash_valueENS_9StringRefE@Base 1:10~svn373870-
1~exp1+0~20191006201134.2786~1.gbp2b7b74
+ _ZN4llvm11APFloatBase10IEEEdoubleEv@Base 1:10~svn373870-
1~exp1+0~20191006201134.2786~1.gbp2b7b74
+ _ZN4llvm11APFloatBase10IEEEsingleEv@Base 1:10~svn373870-
1~exp1+0~20191006201134.2786~1.gbp2b7b74
+ _ZN4llvm11APFloatBase15EnumToSemanticsENS0_9SemanticsE@Base 1:10~svn373870-
1~exp1+0~20191006201134.2786~1.gbp2b7b74

Full log here:
https://llvm-jenkins.debian.net/view/Debian%2011%20-%20unstable/job/llvm-toolchain-binaries/1734/architecture=amd64,distribution=unstable/console

Not sure what changed
Quuxplusone commented 5 years ago
Actually, it is because libclang-10.so links against libclang-cpp.so.10

"/home/sylvestre/dev/debian/pkg-llvm/llvm-toolchain/branches/llvm-toolchain-
snapshot_10~svn374033/build-llvm/./bin/clang++" -fPIC  -fuse-ld=gold -fPIC -Wno-
unused-command-line-argument -Wno-unknown-warning-option -fPIC -fvisibility-
inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -std=c++14 -
Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-
initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wcovered-switch-
default -Wno-class-memaccess -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-
virtual-dtor -Wstring-conversion -ffunction-sections -fdata-sections -fno-
common -Woverloaded-virtual -Wno-nested-anon-types -O2 -DNDEBUG -g1  -Wl,-O3 -
Wl,--gc-sections  -Wl,--version-script,"/home/sylvestre/dev/debian/pkg-
llvm/llvm-toolchain/branches/llvm-toolchain-snapshot_10~svn374033/build-
llvm/tools/clang/stage2-bins/tools/clang/tools/libclang/libclang.exports" -Wl,-
z,relro -Wl,-z,defs -Wl,-z,nodelete -flto=thin -Wl,-z,defs -Wl,-z,nodelete -
shared -Wl,-soname,libclang-10.so.1 -o ../../../../lib/libclang-10.so.1
CMakeFiles/libclang.dir/ARCMigrate.cpp.o
CMakeFiles/libclang.dir/BuildSystem.cpp.o CMakeFiles/libclang.dir/CIndex.cpp.o
CMakeFiles/libclang.dir/CIndexCXX.cpp.o
CMakeFiles/libclang.dir/CIndexCodeCompletion.cpp.o
CMakeFiles/libclang.dir/CIndexDiagnostic.cpp.o
CMakeFiles/libclang.dir/CIndexHigh.cpp.o
CMakeFiles/libclang.dir/CIndexInclusionStack.cpp.o
CMakeFiles/libclang.dir/CIndexUSRs.cpp.o CMakeFiles/libclang.dir/CIndexer.cpp.o
CMakeFiles/libclang.dir/CXComment.cpp.o CMakeFiles/libclang.dir/CXCursor.cpp.o
CMakeFiles/libclang.dir/CXIndexDataConsumer.cpp.o
CMakeFiles/libclang.dir/CXCompilationDatabase.cpp.o
CMakeFiles/libclang.dir/CXLoadedDiagnostic.cpp.o
CMakeFiles/libclang.dir/CXSourceLocation.cpp.o
CMakeFiles/libclang.dir/CXStoredDiagnostic.cpp.o
CMakeFiles/libclang.dir/CXString.cpp.o CMakeFiles/libclang.dir/CXType.cpp.o
CMakeFiles/libclang.dir/Indexing.cpp.o
CMakeFiles/libclang.dir/FatalErrorHandler.cpp.o -Wl,-rpath,"\$ORIGIN/../lib"
../../../../lib/libclangAST.a ../../../../lib/libclangBasic.a
../../../../lib/libclangDriver.a ../../../../lib/libclangFrontend.a
../../../../lib/libclangIndex.a ../../../../lib/libclangLex.a
../../../../lib/libclangSema.a ../../../../lib/libclangSerialization.a
../../../../lib/libclangTooling.a ../../../../lib/libLLVMSupport.a
../../../../lib/libclangARCMigrate.a ../../../../lib/libclangTidyPlugin.a
../../../../lib/libclangIncludeFixerPlugin.a -ldl -lz -lrt -ldl -ltinfo -lm
../../../../lib/libLLVMDemangle.a ../../../../lib/libclangTidyAndroidModule.a
../../../../lib/libclangTidyAbseilModule.a
../../../../lib/libclangTidyBoostModule.a
../../../../lib/libclangTidyCERTModule.a
../../../../lib/libclangTidyDarwinModule.a
../../../../lib/libclangTidyFuchsiaModule.a
../../../../lib/libclangTidyHICPPModule.a
../../../../lib/libclangTidyBugproneModule.a
../../../../lib/libclangTidyCppCoreGuidelinesModule.a
../../../../lib/libclangTidyGoogleModule.a
../../../../lib/libclangTidyLinuxKernelModule.a
../../../../lib/libclangTidyLLVMModule.a
../../../../lib/libclangTidyMiscModule.a
../../../../lib/libclangTidyModernizeModule.a
../../../../lib/libclangTidyObjCModule.a
../../../../lib/libclangTidyOpenMPModule.a
../../../../lib/libclangTidyPerformanceModule.a
../../../../lib/libclangTidyPortabilityModule.a
../../../../lib/libclangTidyReadabilityModule.a
../../../../lib/libclangTidyZirconModule.a
../../../../lib/libclangTidyMPIModule.a ../../../../lib/libclangTidyUtils.a
../../../../lib/libclangTidy.a ../../../../lib/libclang-cpp.so.10
../../../../lib/libclangToolingRefactoring.a
../../../../lib/libclangStaticAnalyzerCheckers.a
../../../../lib/libclangStaticAnalyzerCore.a ../../../../lib/libclangCrossTU.a
../../../../lib/libclangIndex.a -lpthread
../../../../lib/libclangIncludeFixer.a ../../../../lib/libfindAllSymbols.a
../../../../lib/libclangTooling.a ../../../../lib/libclangFrontend.a
../../../../lib/libclangDriver.a ../../../../lib/libclangParse.a
../../../../lib/libclangSerialization.a ../../../../lib/libclangSema.a
../../../../lib/libclangEdit.a ../../../../lib/libclangAnalysis.a
../../../../lib/libclangFormat.a ../../../../lib/libclangToolingInclusions.a
../../../../lib/libclangToolingCore.a ../../../../lib/libclangRewrite.a
../../../../lib/libclangASTMatchers.a ../../../../lib/libclangAST.a
../../../../lib/libclangLex.a ../../../../lib/libclangBasic.a
../../../../lib/libLLVM-10.so.1
Quuxplusone commented 5 years ago
Not sure why but reverting the following commit fixed the issue:

commit 0820041e1daa158f39ab2e414d03c7eb2d1260d7
Author: Michal Gorny <mgorny@gentoo.org>
Date:   Fri Oct 4 20:30:02 2019 +0000

    [clang-tools-extra] [cmake] Link against libclang-cpp whenever possible

    Use clang_target_link_libraries() in order to support linking against
    libclang-cpp instead of static libraries.

    Differential Revision: https://reviews.llvm.org/D68448

    llvm-svn: 373786
Quuxplusone commented 5 years ago
And the potential fix:
https://reviews.llvm.org/D68927