<https://stackoverflow.com/questions/597078/file-line-and-function-usage-in-c>


        __FILE__
        __LINE__

        __FUNCTION__

        __func__
        __PRETTY_FUNCTION__


---

RPATH (20210821)

        <http://jorgen.tjer.no/post/2014/05/20/dt-rpath-ld-and-at-rpath-dyld/>
        <https://wincent.com/wiki/@executable_path,_@load_path_and_@rpath>

        <https://unix.stackexchange.com/questions/22926/where-do-executables-look-for-shared-objects-at-runtime>
        <https://medium.com/@donblas/fun-with-rpath-otool-and-install-name-tool-e3e41ae86172>
        <https://www.unix.com/man-page/osx/1/install_name_tool/>
        <https://stackoverflow.com/questions/33991581/install-name-tool-to-update-a-executable-to-search-for-dylib-in-mac-os-x>

search order:

        <https://unix.stackexchange.com/questions/22926/where-do-executables-look-for-shared-objects-at-runtime>
        <https://stackoverflow.com/questions/36015224/order-in-which-library-directories-are-searched-and-linked>

Linux:
        <https://unix.stackexchange.com/questions/571861/is-there-an-rpath-for-dynamic-linked-libraries>
        (<https://stackoverflow.com/questions/49138195/whats-the-difference-between-rpath-link-and-l>)

        <https://nehckl0.medium.com/creating-relocatable-linux-executables-by-setting-rpath-with-origin-45de573a2e98>
        <https://flameeyes.blog/2010/06/20/the-why-and-how-of-rpath/>
        <https://stackoverflow.com/questions/26280738/what-is-the-equivalent-of-loader-path-for-rpath-specification-on-linux/26281226>
        <https://linux.die.net/man/1/chrpath>

MacOS:
        relative locations:
                @executable_path
                @loader_path      <--- relative to library


        query:
                otool -l path/to/binary

        change binary:

           install_name_tool, e.g.

           sudo install_name_tool -add_rpath /Library/Frameworks/ooRexx.framework/Versions/A/Libraries/ libBSF4ooRexx.dylib

        rpath for MacOS (20210822):

                @loader_path:@loader_path/../lib:/usr/local/lib:/Library/Frameworks/ooRexx.framework/Libraries:/opt/oorexx/lib

Linux:

        relative locations:
                $ORIGIN         <--- relative to binary

        query:
                objdump -x path/to/binary | grep -i rpath
                readelf -d path/to/binary

        change binary:
                chrpath -l path/to/binary

        linking: for libraries use "-rpath-link", for executables "-rpath"
                -Wl,-rpath .:..:
                 -Wl,-rpath,$$'ORIGIN'   <--- weird escapes needed to yield $ORIGIN on the command line!

                problem: <https://stackoverflow.com/questions/52018092/how-to-set-rpath-and-runpath-with-gcc-ld>,
                         default got changed to create RUNPATH instead of RPATH, solution:

                        -Wl,--disable-new-dtags

        rpath-link for Linux (20210823):

                32-bit:
                $$'ORIGIN':$$'ORIGIN'/../lib:/usr/local/lib:/usr/lib:/opt/oorexx/lib

                64-bit:
                $$'ORIGIN':$$'ORIGIN'/../lib:/usr/local/lib64:/usr/lib64:/usr/local/lib:/usr/lib:/opt/oorexx/lib


Java dumps (as of 2021-11-30): https://inside.java/2021/04/30/failed-writing-core-dump/
        hint: to work on Unix one needs to set: ulimit -c unlimited
