abseil / abseil/abseil-cpp

Have Bazel rules for creating shared libraries

オープン
#1,746 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
C++
スター
18.1k
フォーク
3.2k
平均マージ
20時間 36分
マージ済み PR(30日)
1

説明

### Describe the issue

it is possible to build shared libraries with cmake with BUILD_SHARED_LIBS=ON

AFAIK, it is not possible to create them with Bazel.
According to https://ltekieli.com/linux-shared-libraries-with-cmake-and-bazel/
it requires additional cc_shared_library rules to setup up the needed dynamic deps.

The reason why it is important to have this feature setup, it is to allow to build other projects linking with abseil that are exclusively using bazel.

For example, https://github.com/google/tcmalloc is such project.

It currently statically links with abseil. This makes it impossible to build tcmalloc as a shared library and use the resulting so lib file in a project also linking with cmake generated Abseil libraries without breaking the ODR rule.

Being able to build Abseil shared libraries within Bazel is a prerequisite to be able to build tcmalloc shared libraries that can be used with projects already dynamically linking with Abseil.

### Steps to reproduce the problem

there is no cc_shared_library rules in abseil BUILD files or if it is possible to create shared libraries, it is not well documented.

I could not find anything on the topic.

### What version of Abseil are you using?

20240722 LTS

### What operating system and version are you using?

ArchLinux kernel 6.10.4

### What compiler and version are you using?

gcc version 14.2.1 20240805 (GCC)

### What build system are you using?

bazel 7.2.1

### Additional context

_No response_

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

既存の BUILD ファイルを確認して、現在の cc_library ルールを理解します。Bazel で cc_shared_library がどのように機能するかを調査し、指針としてリンク先のブログ記事を確認します。目標は、tcmalloc のようなプロジェクトと互換性のある共有ライブラリを生成するルールを追加し、CMake でビルドされた Abseil と一緒に使用したときに ODR を破らないようにすることです。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
cpp
領域
build-system
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
30/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。