Coder Social home page Coder Social logo

Build failure with clang about openlibm HOT 10 CLOSED

juliamath avatar juliamath commented on September 15, 2024
Build failure with clang

from openlibm.

Comments (10)

vtjnash avatar vtjnash commented on September 15, 2024

It should be OK to just delete those lines. (by which I mean I don't know what they really do)
it is caused by this: __weak_reference(__isinff, isinff);
from the definition of weak reference in: https://github.com/JuliaLang/openlibm/blob/master/include/cdefs-compat.h

from openlibm.

Keno avatar Keno commented on September 15, 2024

IIRC those are debug directives, so it should be fine to delete them (or comment them out) for now. If we run into any problems while debugging we can always take a second look.

from openlibm.

vtjnash avatar vtjnash commented on September 15, 2024

I though it was a linker command that controls the symbol's scope and allows it to finish compiling when there would otherwise be conflicts with certain built-in functions. But my research may very well be completely faulty.

from openlibm.

ViralBShah avatar ViralBShah commented on September 15, 2024

That does sound like a likely explanation.

-viral

On 02-Jul-2012, at 8:54 PM, Jameson Nash wrote:

I though it was a linker command that controls the symbol's scope and allows it to finish compiling when there would otherwise be conflicts with certain built-in functions. But my research may very well be completely faulty.


Reply to this email directly or view it on GitHub:
#9 (comment)

from openlibm.

ViralBShah avatar ViralBShah commented on September 15, 2024

If that is indeed the reason, then we may not be able to simply delete, right?

-viral

On 02-Jul-2012, at 8:54 PM, Jameson Nash wrote:

I though it was a linker command that controls the symbol's scope and allows it to finish compiling when there would otherwise be conflicts with certain built-in functions. But my research may very well be completely faulty.


Reply to this email directly or view it on GitHub:
#9 (comment)

from openlibm.

Keno avatar Keno commented on September 15, 2024

It seems that we need to find the correct weak reference directives for the Mach-O binary format. I'm digging through the apple developer manual and it seems that there are the proper directives to do that, but their usage is a little different. I'll see if I can get it to work.

from openlibm.

Keno avatar Keno commented on September 15, 2024

Ok, found it. This works, but I don't have git set up atm and I need to leave (be back in 30min), so feel free to apply in the meantime:


diff --git a/include/cdefs-compat.h b/include/cdefs-compat.h
index be310a1..81b1a62 100644
--- a/include/cdefs-compat.h
+++ b/include/cdefs-compat.h
@@ -49,6 +49,10 @@
        __asm__(".asciz \"msg\"");      \
        __asm__(".previous")
 #endif /* __STDC__ */
+#elif defined(__clang__)  /* !__ELF__ */
+#define __weak_reference(sym,alias)    \
+       __asm__(".weak_reference alias");\
+       __asm__(".set alias, sym")
 #else  /* !__ELF__ */
 #ifdef __STDC__
 #define __weak_reference(sym,alias)    \

from openlibm.

ViralBShah avatar ViralBShah commented on September 15, 2024

Actually, I get a link time failure

    LINK libopenlibm.dylib
<inline asm>:5:13: error: invalid reassignment of non-absolute variable 'alias'
.set alias, sym
            ^
LLVM ERROR: Error parsing inline asm

clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libopenlibm.dylib] Error 1

from openlibm.

Keno avatar Keno commented on September 15, 2024

Ah, yes. Inline assembly, not assembly by itself. Should be fixed.

from openlibm.

staticfloat avatar staticfloat commented on September 15, 2024

I'm running into this again when trying to use gcc-5 on OSX to compile libopenlibm. This is killing my GCC-based OSX build that I'm trying to do.

$ make
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C build/openlibm-3ee2a6e6a9fc68cbf2ab00f830b9059215e40b06/ ARCH="x86_64" CC="gcc-5" FC="gfortran -m64" AR="ar" OS="Darwin" USECLANG=0 USEGCC=1 DESTDIR="" prefix=/Users/sabae/src/julia/usr bindir=/Users/sabae/src/julia/usr/bin libdir=/Users/sabae/src/julia/usr/lib libexecdir=/Users/sabae/src/julia/usr/libexec datarootdir=/Users/sabae/src/julia/usr/share includedir=/Users/sabae/src/julia/usr/include sysconfdir=/Users/sabae/src/julia/usr/etc O=
gcc-5  -fno-gnu89-inline -std=c99 -Wall -O3 -I/Users/sabae/src/julia/deps/build/openlibm-3ee2a6e6a9fc68cbf2ab00f830b9059215e40b06 -I/Users/sabae/src/julia/deps/build/openlibm-3ee2a6e6a9fc68cbf2ab00f830b9059215e40b06/include -I/Users/sabae/src/julia/deps/build/openlibm-3ee2a6e6a9fc68cbf2ab00f830b9059215e40b06/ld80 -I/Users/sabae/src/julia/deps/build/openlibm-3ee2a6e6a9fc68cbf2ab00f830b9059215e40b06/amd64 -I/Users/sabae/src/julia/deps/build/openlibm-3ee2a6e6a9fc68cbf2ab00f830b9059215e40b06/src -DASSEMBLER -D__BSD_VISIBLE -Wno-implicit-function-declaration -fPIC -I/Users/sabae/local/include -I/usr/local/include -c src/s_isinf.c -o src/s_isinf.c.o
/var/folders/zk/nh41l40158l2hr22v7mhzf4c0000gn/T//ccpiR1KV.s:1:9: error: unsupported directive '.stabs'
        .stabs "_isinff",11,0,0,0
               ^
/var/folders/zk/nh41l40158l2hr22v7mhzf4c0000gn/T//ccpiR1KV.s:2:9: error: unsupported directive '.stabs'
        .stabs "___isinff",1,0,0,0
               ^
make[2]: *** [src/s_isinf.c.o] Error 1
make[1]: *** [build/openlibm-3ee2a6e6a9fc68cbf2ab00f830b9059215e40b06/libopenlibm.dylib] Error 2
make: *** [julia-deps] Error 2

from openlibm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.