eclipse-score / eclipse-score/lifecycle

launch_manager daemon fails to link on glibc < 2.34 (missing -lrt for shm_open/shm_unlink)

Open
#617 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
6
Forks
34
Avg merge
2d 3h
Merged PRs (30d)
80

Description

## Description

`score/launch_manager/src/daemon/BUILD`'s `launch_manager` `cc_binary` only links
`-lpthread` on Linux. `process_group_manager.cpp` and
`details/process_launcher.cpp` both call `shm_open`/`shm_unlink`
(`score/launch_manager/src/daemon/src/process_group_manager/`), which live in
`librt` on glibc versions before 2.34 (glibc 2.34 folded `librt`'s symbols into
`libc` itself, so newer glibc happens to link fine either way, masking the
missing dependency).

On a glibc < 2.34 toolchain, linking `launch_manager` fails with undefined
references to `shm_open`/`shm_unlink`.

## Steps to reproduce

Build `//score/launch_manager/src/daemon:launch_manager` against a Linux glibc
target older than 2.34.

## Expected behavior

`launch_manager` links successfully regardless of the target's glibc version.

## Proposed fix

Add `-lrt` alongside `-lpthread` in the `cc_binary`'s Linux `linkopts`. Draft PR
incoming.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.