# libflangrti.so not linked to libexecinfo



## Dima Pasechnik (Jan 25, 2019)

Using flang as linker without supplying -libexecinfo is pretty much broken, one gets errors like


```
/usr/local/flang/lib/libflangrti.so: undefined reference to `backtrace_symbols'
/usr/local/flang/lib/libflangrti.so: undefined reference to `backtrace'
clang-6.0: error: linker command failed with exit code 1 (use -v to see invocation)
```

Of course one can add `-lexecinfo` to each such call, then it works, but isn't it a bug? After all, using clang as a linker just works, why it should not be the case for flang?


----------



## Dima Pasechnik (Jan 25, 2019)

Well, this might be an option --- although I don't think so, as libflangrti is really not linked to libexecinfo:

```
]$ ldd /usr/local/flang/lib/libflangrti.so
/usr/local/flang/lib/libflangrti.so:
        libm.so.5 => /lib/libm.so.5 (0x80067f000)
        libomp.so => /usr/local/llvm60/lib/libomp.so (0x8006b1000)
        libc.so.7 => /lib/libc.so.7 (0x800248000)
        libthr.so.3 => /lib/libthr.so.3 (0x80074a000)
```
but doesn't this still mean that this is a bug? 

And a similar story is with the Fortran's headers (a.k.a. modules in Fortran) directory, which is  /usr/local/flang/include,
and so to use e.g. omp_lib module I must compile explicitly adding -I/usr/local/flang/include.  Again, shouldn't it be in the compiler's default path for includes?


----------

