Re: clang and static linking?

2012-11-10 Thread Jilles Tjoelker
On Sat, Nov 10, 2012 at 01:33:40AM +0100, Dimitry Andric wrote: On 2012-11-10 00:25, Dimitry Andric wrote: ... The more difficult way out is to not define any duplicate functions in libc.a and libm.a. For the shared libraries, this should not be a problem, since the dynamic linker will

Re: clang and static linking?

2012-11-10 Thread Dimitry Andric
On 2012-11-10 22:39, Jilles Tjoelker wrote: On Sat, Nov 10, 2012 at 01:33:40AM +0100, Dimitry Andric wrote: ... - Only define isnan, isnanf, __isnan and __isnanf in libc.so, not in libc.a and libc_p.a. OK, but please add a comment about this. Where? In libc or libm? - Define isnan

Re: clang and static linking?

2012-11-09 Thread Konstantin Belousov
On Thu, Nov 08, 2012 at 03:49:32PM -0800, Steve Kargl wrote: On Thu, Nov 08, 2012 at 03:13:49PM -0800, Steve Kargl wrote: Upgraded my amd64 system, yesterday. Needed to rebuild one of my projects, and hit /usr/local/openmpi-1.6.3/bin/mpif90 -static -O2 -pipe -march=native

Re: clang and static linking?

2012-11-09 Thread Roman Divacky
On Fri, Nov 09, 2012 at 02:00:12PM +0200, Konstantin Belousov wrote: On Thu, Nov 08, 2012 at 03:49:32PM -0800, Steve Kargl wrote: On Thu, Nov 08, 2012 at 03:13:49PM -0800, Steve Kargl wrote: Upgraded my amd64 system, yesterday. Needed to rebuild one of my projects, and hit

Re: clang and static linking?

2012-11-09 Thread Steve Kargl
On Fri, Nov 09, 2012 at 02:00:12PM +0200, Konstantin Belousov wrote: On Thu, Nov 08, 2012 at 03:49:32PM -0800, Steve Kargl wrote: This appears to fix the problem. Don't know if this is th right way to handle it. Index: src/s_isnan.c

Re: clang and static linking?

2012-11-09 Thread Roman Divacky
On Fri, Nov 09, 2012 at 08:43:04AM -0800, Steve Kargl wrote: On Fri, Nov 09, 2012 at 02:00:12PM +0200, Konstantin Belousov wrote: On Thu, Nov 08, 2012 at 03:49:32PM -0800, Steve Kargl wrote: This appears to fix the problem. Don't know if this is th right way to handle it.

Re: clang and static linking?

2012-11-09 Thread Steve Kargl
On Fri, Nov 09, 2012 at 05:45:41PM +0100, Roman Divacky wrote: On Fri, Nov 09, 2012 at 08:43:04AM -0800, Steve Kargl wrote: On Fri, Nov 09, 2012 at 02:00:12PM +0200, Konstantin Belousov wrote: There is some magic switch to reduce amount of clang bugs, like -fno-integrated-as. Please

Re: clang and static linking?

2012-11-09 Thread Dimitry Andric
On 2012-11-09 17:45, Roman Divacky wrote: On Fri, Nov 09, 2012 at 08:43:04AM -0800, Steve Kargl wrote: ... ... I'll try this shortly. Does this mean that we need to build all *.a libraries where a weak reference may occur with this switch? No, this has nothing to do with llvm integrated

Re: clang and static linking?

2012-11-09 Thread Konstantin Belousov
On Fri, Nov 09, 2012 at 08:43:04AM -0800, Steve Kargl wrote: On Fri, Nov 09, 2012 at 02:00:12PM +0200, Konstantin Belousov wrote: On Thu, Nov 08, 2012 at 03:49:32PM -0800, Steve Kargl wrote: This appears to fix the problem. Don't know if this is th right way to handle it.

Re: clang and static linking?

2012-11-09 Thread Dimitry Andric
On 2012-11-09 00:13, Steve Kargl wrote: Upgraded my amd64 system, yesterday. Needed to rebuild one of my projects, and hit /usr/local/openmpi-1.6.3/bin/mpif90 -static -O2 -pipe -march=native -mtune=native -funroll-loops -ftree-vectorize -Wall -rpath /usr/local/lib/gcc46 -I/home/kargl/modules

Re: clang and static linking?

2012-11-09 Thread Steve Kargl
On Fri, Nov 09, 2012 at 07:02:48PM +0100, Dimitry Andric wrote: On 2012-11-09 00:13, Steve Kargl wrote: Upgraded my amd64 system, yesterday. Needed to rebuild one of my projects, and hit /usr/local/openmpi-1.6.3/bin/mpif90 -static -O2 -pipe -march=native -mtune=native -funroll-loops

Re: clang and static linking?

2012-11-09 Thread Dimitry Andric
On 2012-11-09 19:28, Steve Kargl wrote: On Fri, Nov 09, 2012 at 07:02:48PM +0100, Dimitry Andric wrote: ... Can you please post a reduced testcase? I cannot reproduce this error on -current, however much I tried. My testcases attempted calling isnan() and isnanf(), then I tried statically

Re: clang and static linking?

2012-11-09 Thread Dimitry Andric
On 2012-11-09 20:38, Dimitry Andric wrote: On 2012-11-09 19:28, Steve Kargl wrote: ... I'll see what I can do. sasmp is a fairly large OpenMPI program. Sorry, never mind that. I found a simple testcase: #include math.h int main(int argc, char *argv[]) { return isnan((double)argc)

Re: clang and static linking?

2012-11-09 Thread Dimitry Andric
On 2012-11-10 00:25, Dimitry Andric wrote: ... The more difficult way out is to not define any duplicate functions in libc.a and libm.a. For the shared libraries, this should not be a problem, since the dynamic linker will figure out which of the two copies will get precedence. The functions

Re: clang and static linking?

2012-11-09 Thread Steve Kargl
On Sat, Nov 10, 2012 at 01:33:40AM +0100, Dimitry Andric wrote: On 2012-11-10 00:25, Dimitry Andric wrote: ... The more difficult way out is to not define any duplicate functions in libc.a and libm.a. For the shared libraries, this should not be a problem, since the dynamic linker will

Re: clang and static linking?

2012-11-08 Thread Steve Kargl
On Thu, Nov 08, 2012 at 03:13:49PM -0800, Steve Kargl wrote: Upgraded my amd64 system, yesterday. Needed to rebuild one of my projects, and hit /usr/local/openmpi-1.6.3/bin/mpif90 -static -O2 -pipe -march=native -mtune=native -funroll-loops -ftree-vectorize -Wall -rpath