RTEMS Source Builder | rsb(rtems-build-dep): handle multiple library paths (!32)

Agustin Catellani (@holagus) gitlab at rtems.org
Sat Jun 29 16:49:57 UTC 2024



Agustin Catellani created a merge request: https://gitlab.rtems.org/rtems/tools/rtems-source-builder/-/merge_requests/32

Project:Branches: holagus/rtems-source-builder:fix-rtems-build-dep to rtems/tools/rtems-source-builder:main
Author:   Agustin Catellani




## Summary

The script `rtems-build-dep` might fail to find a library if multiple `-L path` arguments are passed. 

The argument parser only keeps the last library path provided:

```bash
# source-builder/sb/rtems-build-dep
            libraries="$2"; shift;
            shift;;
```

Take the following example. We are trying to find `libpython3.so`, which can be found on /usr/lib:

```bash
$ rtems-build-dep -c gcc -L /usr/lib -l libpython3.so # this works because we only pass -L once
> found

$ rtems-build-dep -c gcc -L /tmp/ -L /usr/lib -l libpython3.so # this also works because /usr/lib is the last path provided
> found

$ rtems-build-dep -c gcc -L /usr/lib -L /tmp/ -l libpython3.so # this fails because /usr/lib is discarded
> not-found
```

I've made a change to handle multiple library paths in the same fashion multiple include directories are handled.

<!-- Default settings, if it is a dropdown it will set after submission -->

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/tools/rtems-source-builder/-/merge_requests/32
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20240629/61da9c79/attachment.htm>


More information about the bugs mailing list