Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qestion: does gllvm include the .a in the .bc file? #62

Closed
TimHe95 opened this issue Mar 23, 2022 · 1 comment
Closed

Qestion: does gllvm include the .a in the .bc file? #62

TimHe95 opened this issue Mar 23, 2022 · 1 comment

Comments

@TimHe95
Copy link

TimHe95 commented Mar 23, 2022

  • ubuntu 18.04
  • go 1.15.15
  • llvm 10.0.0
  • gllvm install by go get ...
  • mysql 8.0.22

Steps:

mkdir mysql-8.0.22-source/build && cd  mysql-8.0.22-source/build
cmake .. -DWITH_BOOST=../../boost_1_73_0 -DCMAKE_C_COMPILER=/usr/bin/gclang -DCMAKE_CXX_COMPILER=/usr/bin/gclang++ -DCMAKE_C_LINK_FLAGS=-rdynamic -DCMAKE_CXX_LINK_FLAGS=-rdynamic -DCMAKE_MODULE_LINKER_FLAGS=-rdynamic -DCMAKE_SHARED_LINKER_FLAGS=-rdynamic
make
get-bc bin/mysqld

I want to get mysqld.bc. When looking into the compile commands (-DCMAKE_VERBOSE_MAKEFILE=ON), it links many static libraries to generate the mysqld binary where many .a files are included (e.g. libinnobase.a). These libraries are also generated from code of mysql.

The linking command of mysqld:

gclang++ -std=c++14 -fno-omit-frame-pointer -ftls-model=initial-exec  -Wall -Wextra -Wformat-security -Wvla -Wundef -Wmissing-format-attribute -Woverloaded-virtual -Wcast-qual -Wno-null-conversion -Wno-unused-private-field -Wconditional-uninitialized -Wdeprecated -Wextra-semi -Wheader-hygiene -Wnon-virtual-dtor -Wundefined-reinterpret-cast -Winconsistent-missing-destructor-override -Winconsistent-missing-override -Wshadow-field -DDBUG_OFF -ffunction-sections -fdata-sections -O2 -g -DNDEBUG -rdynamic -fuse-ld=gold -Wl,--gc-sections -Wl,--export-dynamic -rdynamic ../runtime_output_directory/mysqld.o  -o ../runtime_output_directory/mysqld_hhc -Wl,-rpath,/home/timhe/Downloads/mysql-server-mysql-8.0.22/build/library_output_directory: -lpthread libsql_main.a libsql_gis.a libbinlog.a librpl.a libmaster.a libslave.a libsql_dd.a ../archive_output_directory/libmysys.a ../components/libminchassis/libminchassis.a ../libbinlogevents/lib/libbinlogevents.a ../extra/icu/source/i18n/libicui18n.a ../extra/icu/source/common/libicuuc.a ../extra/icu/source/stubdata/libicustubdata.a ../storage/innobase/libinnobase.a libsql_main.a libsql_gis.a libbinlog.a librpl.a libmaster.a libslave.a libsql_dd.a ../storage/innobase/libinnobase.a libsql_main.a libsql_gis.a libbinlog.a librpl.a libmaster.a libslave.a libsql_dd.a ../storage/innobase/libinnobase.a ../storage/archive/libarchive.a ../storage/blackhole/libblackhole.a ../storage/csv/libcsv.a ../storage/federated/libfederated.a ../storage/heap/libheap.a ../storage/heap/libheap_library.a ../storage/myisam/libmyisam.a ../storage/myisam/libmyisam_library.a ../storage/myisammrg/libmyisammrg.a ../storage/perfschema/libperfschema.a ../storage/temptable/libtemptable.a ../plugin/fulltext/libngram_parser.a ../plugin/x/libmysqlx.a ../extra/icu/source/i18n/libicui18n.a ../extra/icu/source/common/libicuuc.a ../extra/icu/source/stubdata/libicustubdata.a ../extra/libevent/libevent-2.1.11-stable/lib/libevent_extra.a ../extra/libevent/libevent-2.1.11-stable/lib/libevent_openssl.a ../extra/libevent/libevent-2.1.11-stable/lib/libevent_core.a ../extra/libevent/libevent-2.1.11-stable/lib/libevent_pthreads.a ../plugin/x/protocol/protobuf/libmysqlxmessages_lite.a ../library_output_directory/libprotobuf-lite.so.3.11.4 server_component/libmysql_server_component_services.a ../archive_output_directory/libvio.a -lcrypt ../libbinlogevents/lib/libbinlogevents.a ../archive_output_directory/libmysys.a ../archive_output_directory/libstrings.a ../archive_output_directory/libmysys.a ../archive_output_directory/libstrings.a ../archive_output_directory/libmytime.a -lm -lrt /usr/lib/x86_64-linux-gnu/libssl.so /usr/lib/x86_64-linux-gnu/libcrypto.so -ldl ../archive_output_directory/libzstd.a ../archive_output_directory/libz.a ../liblz4_lib.a -laio -lpthread

Question

So would gllvm also include functions, variables, and other things in those .a files?
Thanks!

@ianamason
Copy link
Member

When you extract the bc ask for a manifest too, and take a look. It should include all the bitcode that
is in the executables bitcode path section.

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

No branches or pull requests

2 participants