Add linker tools

オープン
#289 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

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

調査の方向性

まず、コンパイラツールに関する setup-cpp CLI と GitHub Actions のオプション処理を追跡し、task で言及されている clangtidy 形式のサポートと比較します。issue に示されている CMakeOptions.cmake と find_linker の使用方法を確認し、指定されたプラットフォームでの lld、mold、sold、gold のインストールおよび選択の動作を定義します。CLI と Actions の設定を通じて要求された linker オプションを選択できれば完了です。

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

説明

enhancement

Tasks

  • lld can be easily added as it is already supported. We just need to add a CLI and actions option for it. It should be treated the same as clangtidy, etc.
  • mold
  • sold
  • gold

Description

Hi,
I was using setup-cpp with project_options (in my docker build) and custemize the linker option, see find_linker.

Would be nice to install mold or one of the other (better) Linker, rather then (gcc) ld or gold.

image
Improving C++ Compilation Times: Tools & Techniques - Vittorio Romeo - ACCU 2023

So install (?) ...

  • mold (e.g. when compiler is gcc)
  • lld when compiler is llvm (default)
  • sold for Mac OS
  • windows: ???
npx setup-cpp --compiler gcc --linker mold --cmake true --ninja true --ccache true --vcpkg true

More Context

I was getting this Error: /usr/bin/ld.gold: separate-code: unknown -z option.

CMakeOptions.cmake

find_linker(PROJECT_OPTIONS_LINKER)
MESSAGE(STATUS "Use Linker: ${PROJECT_OPTIONS_LINKER}")
project_options(
  ...
  LINKER
  ${PROJECT_OPTIONS_LINKER})
Compiler found: /usr/bin/g++-13
Use Linker: gold

After that I just installed mold and everything works:

RUN apt-get update -qq && \
    # install nodejs
    apt-get install -y --no-install-recommends nodejs npm && \
    # install setup-cpp
    npm install -g [email protected] && \
    # install the compiler and tools
    setup-cpp \
        --nala true \
        --compiler ${compiler} \
        --cmake true \
        --ninja true \
        --task true \
        --vcpkg true \
        --cppcheck true \
        --gcovr true \
        --doxygen true \
        --ccache true && \
    # install custom linker
    apt-get install -y --no-install-recommends mold && \
    # cleanup
    nala autoremove -y && \
    nala autopurge -y && \
    apt-get clean && \
    nala clean --lists && \
    rm -rf /var/lib/apt/lists/* && \
    rm -rf /tmp/*
主要言語
TypeScript
スター
277
フォーク
37
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

aminya/setup-cpp のほかの issue

aminya/setup-cpp の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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