diff --git a/trunk/63303980.patch b/trunk/63303980.patch index 65df4ad37fff..1263af345dc7 100644 --- a/trunk/63303980.patch +++ b/trunk/63303980.patch @@ -538,9 +538,9 @@ index 7cd50ac144c1..57e90a9aa805 100644 namespace { @@ -346,7 +341,7 @@ CloneCtx::CloneCtx(MultiVersioning *pass, Module &M) + T_int32(Type::getInt32Ty(ctx)), T_void(Type::getVoidTy(ctx)), T_psize(PointerType::get(T_size, 0)), - T_pvoidfunc(FunctionType::get(T_void, false)->getPointerTo()), - tbaa_const(tbaa_make_child("jtbaa_const", nullptr, true).first), + tbaa_const(tbaa_make_child_with_context(ctx, "jtbaa_const", nullptr, true).first), pass(pass), diff --git a/trunk/PKGBUILD b/trunk/PKGBUILD index 2ffd5a42864a..2ae73f07be49 100644 --- a/trunk/PKGBUILD +++ b/trunk/PKGBUILD @@ -8,8 +8,8 @@ pkgname=julia epoch=2 -pkgver=1.7.2 -pkgrel=3 +pkgver=1.7.3 +pkgrel=1 arch=(x86_64) pkgdesc='High-level, high-performance, dynamic programming language' url='https://julialang.org/' @@ -31,28 +31,26 @@ source=(https://github.com/JuliaLang/julia/releases/download/v$pkgver/$pkgname-$ julia-system-cblas.patch julia-hardcoded-libs.patch make-install-no-build.patch - julia-llvm-patchelf.patch julia-libunwind-1.6.patch - julia-curl-7.81.patch - julia-libblastrampoline-4.patch) + julia-libblastrampoline-4.patch + julia-gcc-12.patch) backup=(etc/julia/startup.jl) -sha256sums=('c1b4f1f75aac34c40e81805cba2d87f1e72f9ce1405a525273c3688eee12366f' +sha256sums=('4be529b0716de1ec48ba52e83a0fafd4be2269be9cc43074ad15ce788aeca093' 'SKIP' 'a5cd89ce78157362377df382ce5a4fbef14543b818beecc06dfd6d63c90334f2' 'bbaea5ed91577a4633625a339dc1fb48cb4d74893e69bafc993db2953078891c' '9a176b411414825f1694d3fbe377fdc0d4937883a9926db0f531dbac7e75464a' 'c033fce112db85b02ebc1d3c8f8bac1240e0409ffdded7fd3322163834c41257' 'bc6c85cbbca489ef0b2876dbeb6ae493c11573e058507b8bcb9e01273bc3a38c' - 'ce9cd140c3bc39987d60340bf365d6238e79cf4d5385494272c49c64af22ef78' + '96303f5cb520e861c7fdc5eb6d64767b597ecf2057a0aa37250af546738da63e' '40e1f46415a7241c1258d2e9d01890455ac728879a5cc6bb1d8f57d6e1f7a69a' 'cfe498a090d0026b92f9db4ed65ac3818c2efa5ec83bcefed728d27abff73081' '8f8c12853ce847f5d1b5a4a461ddec701decdb81dae7bb31d66560c1deaed97a' '03043f005c133ac9af1d4dc113ea8b525ad3b393690625be77975f0e29dd6457' '8be4605f92a009072ca7e843549c225fc4e959893498e7c4f8f79e861e63714d' - '6048c69c987f33f2b17d78b63368b0762d1d6a1e531ef9932d0c23bda49d1384' '3afa172e8b54ce48e77542677b2b7143199d444bfeed39be1644ce88b513a3d0' - '710587dd88c7698dc5cdf47a1a50f6f144b584b7d9ffb85fac3f5f79c65fce11' - '79cd957d0599a8ee1dbdf7f2ebd1a5bd85ab7e499584858e89a8d9609ba1ced4') + '79cd957d0599a8ee1dbdf7f2ebd1a5bd85ab7e499584858e89a8d9609ba1ced4' + 'b903859c262048057f873e4a39c4837382896d3059860465443823133a5a59da') validpgpkeys=('3673DF529D9049477F76B37566E3C7DC03D6E495') # Julia (Binary signing key) options=(!lto) @@ -80,19 +78,10 @@ prepare() { patch -p1 -i ../make-install-no-build.patch # Fix test failure sed -e 's|0.22314355f0 + 3.1415927f0im|0.22314355f0 - 3.1415927f0im|' -i stdlib/LinearAlgebra/test/lu.jl -# Don't try to run patchelf on system LLVM - patch -p1 -i ../julia-llvm-patchelf.patch # Port to libblastrampoline 4 API patch -p1 -i ../julia-libblastrampoline-4.patch - -# Fix segfault with curl 7.81 - cd stdlib/srccache - tar -xzf Downloads-26d79afcde9cf837a331fce023b31f1d3699700c.tar.gz - patch -d JuliaLang-Downloads.jl-26d79af -p1 < "$srcdir"/julia-curl-7.81.patch - rm Downloads-26d79afcde9cf837a331fce023b31f1d3699700c.tar.gz - tar -czf Downloads-26d79afcde9cf837a331fce023b31f1d3699700c.tar.gz JuliaLang-Downloads.jl-26d79af - md5sum Downloads-26d79afcde9cf837a331fce023b31f1d3699700c.tar.gz | cut -d ' ' -f 1 > ../../deps/checksums/Downloads-26d79afcde9cf837a331fce023b31f1d3699700c.tar.gz/md5 - sha512sum Downloads-26d79afcde9cf837a331fce023b31f1d3699700c.tar.gz | cut -d ' ' -f 1 > ../../deps/checksums/Downloads-26d79afcde9cf837a331fce023b31f1d3699700c.tar.gz/sha512 +# Fix failures with GCC 12 https://github.com/JuliaLang/julia/pull/45249 + patch -p0 -i ../julia-gcc-12.patch } _buildopts="prefix=/usr \ diff --git a/trunk/julia-curl-7.81.patch b/trunk/julia-curl-7.81.patch deleted file mode 100644 index d7286f24f866..000000000000 --- a/trunk/julia-curl-7.81.patch +++ /dev/null @@ -1,28 +0,0 @@ -From a6d88d774087a1bff90a853e769b307a06de9293 Mon Sep 17 00:00:00 2001 -From: Jameson Nash -Date: Mon, 8 Nov 2021 14:25:20 -0500 -Subject: [PATCH] Avoid infinite recursion in `timer_callback` - -Fixes https://github.com/JuliaLang/Downloads.jl/issues/163 ---- - src/Curl/Multi.jl | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -diff --git a/src/Curl/Multi.jl b/src/Curl/Multi.jl -index fc865b0..0ef1b63 100644 ---- a/src/Curl/Multi.jl -+++ b/src/Curl/Multi.jl -@@ -142,12 +142,7 @@ function timer_callback( - )::Cint - multi = unsafe_pointer_to_objref(multi_p)::Multi - @assert multi_h == multi.handle -- if timeout_ms == 0 -- lock(multi.lock) do -- @check curl_multi_socket_action(multi.handle, CURL_SOCKET_TIMEOUT, 0) -- check_multi_info(multi) -- end -- elseif timeout_ms >= 0 -+ if timeout_ms >= 0 - timeout_cb = @cfunction(timeout_callback, Cvoid, (Ptr{Cvoid},)) - uv_timer_start(multi.timer, timeout_cb, max(1, timeout_ms), 0) - elseif timeout_ms == -1 diff --git a/trunk/julia-gcc-12.patch b/trunk/julia-gcc-12.patch new file mode 100644 index 000000000000..3965a8137dae --- /dev/null +++ b/trunk/julia-gcc-12.patch @@ -0,0 +1,521 @@ +--- src/llvm-demote-float16.cpp 2022-05-24 16:26:36.982535055 +0000 ++++ src/llvm-demote-float16.cpp 2022-05-24 19:30:17.191673155 +0000 +@@ -27,6 +27,166 @@ + + namespace { + ++inline AttributeSet getFnAttrs(const AttributeList &Attrs) ++{ ++#if JL_LLVM_VERSION >= 140000 ++ return Attrs.getFnAttrs(); ++#else ++ return Attrs.getFnAttributes(); ++#endif ++} ++ ++inline AttributeSet getRetAttrs(const AttributeList &Attrs) ++{ ++#if JL_LLVM_VERSION >= 140000 ++ return Attrs.getRetAttrs(); ++#else ++ return Attrs.getRetAttributes(); ++#endif ++} ++ ++static Instruction *replaceIntrinsicWith(IntrinsicInst *call, Type *RetTy, ArrayRef args) ++{ ++ Intrinsic::ID ID = call->getIntrinsicID(); ++ assert(ID); ++ auto oldfType = call->getFunctionType(); ++ auto nargs = oldfType->getNumParams(); ++ assert(args.size() > nargs); ++ SmallVector argTys(nargs); ++ for (unsigned i = 0; i < nargs; i++) ++ argTys[i] = args[i]->getType(); ++ auto newfType = FunctionType::get(RetTy, argTys, oldfType->isVarArg()); ++ ++ // Accumulate an array of overloaded types for the given intrinsic ++ // and compute the new name mangling schema ++ SmallVector overloadTys; ++ { ++ SmallVector Table; ++ getIntrinsicInfoTableEntries(ID, Table); ++ ArrayRef TableRef = Table; ++ auto res = Intrinsic::matchIntrinsicSignature(newfType, TableRef, overloadTys); ++ assert(res == Intrinsic::MatchIntrinsicTypes_Match); ++ (void)res; ++ bool matchvararg = !Intrinsic::matchIntrinsicVarArg(newfType->isVarArg(), TableRef); ++ assert(matchvararg); ++ (void)matchvararg; ++ } ++ auto newF = Intrinsic::getDeclaration(call->getModule(), ID, overloadTys); ++ assert(newF->getFunctionType() == newfType); ++ newF->setCallingConv(call->getCallingConv()); ++ assert(args.back() == call->getCalledFunction()); ++ auto newCall = CallInst::Create(newF, args.drop_back(), "", call); ++ newCall->setTailCallKind(call->getTailCallKind()); ++ auto old_attrs = call->getAttributes(); ++ newCall->setAttributes(AttributeList::get(call->getContext(), getFnAttrs(old_attrs), ++ getRetAttrs(old_attrs), {})); // drop parameter attributes ++ return newCall; ++} ++ ++ ++static Value* CreateFPCast(Instruction::CastOps opcode, Value *V, Type *DestTy, IRBuilder<> &builder) ++{ ++ ++ Type *SrcTy = V->getType(); ++ Type *RetTy = DestTy; ++ if (auto *VC = dyn_cast(V)) { ++ // The input IR often has things of the form ++ // fcmp olt half %0, 0xH7C00 ++ // and we would like to avoid turning that constant into a call here ++ // if we can simply constant fold it to the new type. ++ VC = ConstantExpr::getCast(opcode, VC, DestTy, true); ++ if (VC) ++ return VC; ++ } ++ assert(SrcTy->isVectorTy() == DestTy->isVectorTy()); ++ if (SrcTy->isVectorTy()) { ++ unsigned NumElems = cast(SrcTy)->getNumElements(); ++ assert(cast(DestTy)->getNumElements() == NumElems && "Mismatched cast"); ++ Value *NewV = UndefValue::get(DestTy); ++ RetTy = RetTy->getScalarType(); ++ for (unsigned i = 0; i < NumElems; ++i) { ++ Value *I = builder.getInt32(i); ++ Value *Vi = builder.CreateExtractElement(V, I); ++ Vi = CreateFPCast(opcode, Vi, RetTy, builder); ++ NewV = builder.CreateInsertElement(NewV, Vi, I); ++ } ++ return NewV; ++ } ++ auto &M = *builder.GetInsertBlock()->getModule(); ++ auto &ctx = M.getContext(); ++ // Pick the Function to call in the Julia runtime ++ StringRef Name; ++ switch (opcode) { ++ case Instruction::FPExt: ++ // this is exact, so we only need one conversion ++ assert(SrcTy->isHalfTy()); ++ Name = "julia__gnu_h2f_ieee"; ++ RetTy = Type::getFloatTy(ctx); ++ break; ++ case Instruction::FPTrunc: ++ assert(DestTy->isHalfTy()); ++ if (SrcTy->isFloatTy()) ++ Name = "julia__gnu_f2h_ieee"; ++ else if (SrcTy->isDoubleTy()) ++ Name = "julia__truncdfhf2"; ++ break; ++ // All F16 fit exactly in Int32 (-65504 to 65504) ++ case Instruction::FPToSI: JL_FALLTHROUGH; ++ case Instruction::FPToUI: ++ assert(SrcTy->isHalfTy()); ++ Name = "julia__gnu_h2f_ieee"; ++ RetTy = Type::getFloatTy(ctx); ++ break; ++ case Instruction::SIToFP: JL_FALLTHROUGH; ++ case Instruction::UIToFP: ++ assert(DestTy->isHalfTy()); ++ Name = "julia__gnu_f2h_ieee"; ++ SrcTy = Type::getFloatTy(ctx); ++ break; ++ default: ++ errs() << Instruction::getOpcodeName(opcode) << ' '; ++ V->getType()->print(errs()); ++ errs() << " to "; ++ DestTy->print(errs()); ++ errs() << " is an "; ++ llvm_unreachable("invalid cast"); ++ } ++ if (Name.empty()) { ++ errs() << Instruction::getOpcodeName(opcode) << ' '; ++ V->getType()->print(errs()); ++ errs() << " to "; ++ DestTy->print(errs()); ++ errs() << " is an "; ++ llvm_unreachable("illegal cast"); ++ } ++ // Coerce the source to the required size and type ++ auto T_int16 = Type::getInt16Ty(ctx); ++ if (SrcTy->isHalfTy()) ++ SrcTy = T_int16; ++ if (opcode == Instruction::SIToFP) ++ V = builder.CreateSIToFP(V, SrcTy); ++ else if (opcode == Instruction::UIToFP) ++ V = builder.CreateUIToFP(V, SrcTy); ++ else ++ V = builder.CreateBitCast(V, SrcTy); ++ // Call our intrinsic ++ if (RetTy->isHalfTy()) ++ RetTy = T_int16; ++ auto FT = FunctionType::get(RetTy, {SrcTy}, false); ++ FunctionCallee F = M.getOrInsertFunction(Name, FT); ++ Value *I = builder.CreateCall(F, {V}); ++ // Coerce the result to the expected type ++ if (opcode == Instruction::FPToSI) ++ I = builder.CreateFPToSI(I, DestTy); ++ else if (opcode == Instruction::FPToUI) ++ I = builder.CreateFPToUI(I, DestTy); ++ else if (opcode == Instruction::FPExt) ++ I = builder.CreateFPCast(I, DestTy); ++ else ++ I = builder.CreateBitCast(I, DestTy); ++ return I; ++} ++ + struct DemoteFloat16Pass : public FunctionPass { + static char ID; + DemoteFloat16Pass() : FunctionPass(ID){}; +@@ -35,15 +195,40 @@ + bool runOnFunction(Function &F) override; + }; + ++Type *_getWithNewType(Type *VTyp, Type *EltTy) { ++ if (auto *VTy = dyn_cast(VTyp)) ++ return VectorType::get(EltTy, VTy->getElementCount()); ++ return EltTy; ++} ++ ++ + bool DemoteFloat16Pass::runOnFunction(Function &F) + { + auto &ctx = F.getContext(); +- auto T_float16 = Type::getHalfTy(ctx); + auto T_float32 = Type::getFloatTy(ctx); + + SmallVector erase; + for (auto &BB : F) { + for (auto &I : BB) { ++ // extend Float16 operands to Float32 ++ bool Float16 = I.getType()->getScalarType()->isHalfTy(); ++ for (size_t i = 0; !Float16 && i < I.getNumOperands(); i++) { ++ Value *Op = I.getOperand(i); ++ if (Op->getType()->getScalarType()->isHalfTy()) ++ Float16 = true; ++ } ++ if (!Float16) ++ continue; ++ ++ if (auto CI = dyn_cast(&I)) { ++ if (CI->getOpcode() != Instruction::BitCast) { // aka !CI->isNoopCast(DL) ++ IRBuilder<> builder(&I); ++ Value *NewI = CreateFPCast(CI->getOpcode(), I.getOperand(0), I.getType(), builder); ++ I.replaceAllUsesWith(NewI); ++ erase.push_back(&I); ++ } ++ continue; ++ } + switch (I.getOpcode()) { + case Instruction::FNeg: + case Instruction::FAdd: +@@ -54,6 +239,9 @@ + case Instruction::FCmp: + break; + default: ++ if (auto intrinsic = dyn_cast(&I)) ++ if (intrinsic->getIntrinsicID()) ++ break; + continue; + } + +@@ -65,61 +253,68 @@ + IRBuilder<> builder(&I); + + // extend Float16 operands to Float32 +- bool OperandsChanged = false; ++ // XXX: Calls to llvm.fma.f16 may need to go to f64 to be correct? + SmallVector Operands(I.getNumOperands()); + for (size_t i = 0; i < I.getNumOperands(); i++) { + Value *Op = I.getOperand(i); +- if (Op->getType() == T_float16) { +- Op = builder.CreateFPExt(Op, T_float32); +- OperandsChanged = true; ++ if (Op->getType()->getScalarType()->isHalfTy()) { ++ Op = CreateFPCast(Instruction::FPExt, Op, _getWithNewType(Op->getType(), T_float32), builder); + } + Operands[i] = (Op); + } + + // recreate the instruction if any operands changed, + // truncating the result back to Float16 +- if (OperandsChanged) { +- Value *NewI; +- switch (I.getOpcode()) { +- case Instruction::FNeg: +- assert(Operands.size() == 1); +- NewI = builder.CreateFNeg(Operands[0]); +- break; +- case Instruction::FAdd: +- assert(Operands.size() == 2); +- NewI = builder.CreateFAdd(Operands[0], Operands[1]); +- break; +- case Instruction::FSub: +- assert(Operands.size() == 2); +- NewI = builder.CreateFSub(Operands[0], Operands[1]); +- break; +- case Instruction::FMul: +- assert(Operands.size() == 2); +- NewI = builder.CreateFMul(Operands[0], Operands[1]); +- break; +- case Instruction::FDiv: +- assert(Operands.size() == 2); +- NewI = builder.CreateFDiv(Operands[0], Operands[1]); +- break; +- case Instruction::FRem: +- assert(Operands.size() == 2); +- NewI = builder.CreateFRem(Operands[0], Operands[1]); +- break; +- case Instruction::FCmp: +- assert(Operands.size() == 2); +- NewI = builder.CreateFCmp(cast(&I)->getPredicate(), +- Operands[0], Operands[1]); ++ Value *NewI; ++ switch (I.getOpcode()) { ++ case Instruction::FNeg: ++ assert(Operands.size() == 1); ++ NewI = builder.CreateFNeg(Operands[0]); ++ break; ++ case Instruction::FAdd: ++ assert(Operands.size() == 2); ++ NewI = builder.CreateFAdd(Operands[0], Operands[1]); ++ break; ++ case Instruction::FSub: ++ assert(Operands.size() == 2); ++ NewI = builder.CreateFSub(Operands[0], Operands[1]); ++ break; ++ case Instruction::FMul: ++ assert(Operands.size() == 2); ++ NewI = builder.CreateFMul(Operands[0], Operands[1]); ++ break; ++ case Instruction::FDiv: ++ assert(Operands.size() == 2); ++ NewI = builder.CreateFDiv(Operands[0], Operands[1]); ++ break; ++ case Instruction::FRem: ++ assert(Operands.size() == 2); ++ NewI = builder.CreateFRem(Operands[0], Operands[1]); ++ break; ++ case Instruction::FCmp: ++ assert(Operands.size() == 2); ++ NewI = builder.CreateFCmp(cast(&I)->getPredicate(), ++ Operands[0], Operands[1]); ++ break; ++ default: ++ if (auto intrinsic = dyn_cast(&I)) { ++ // XXX: this is not correct in general ++ // some obvious failures include llvm.convert.to.fp16.*, llvm.vp.*to*, llvm.experimental.constrained.*to*, llvm.masked.* ++ Type *RetTy = I.getType(); ++ if (RetTy->getScalarType()->isHalfTy()) ++ RetTy = _getWithNewType(RetTy, T_float32); ++ NewI = replaceIntrinsicWith(intrinsic, RetTy, Operands); + break; +- default: +- abort(); + } +- cast(NewI)->copyMetadata(I); +- cast(NewI)->copyFastMathFlags(&I); +- if (NewI->getType() != I.getType()) +- NewI = builder.CreateFPTrunc(NewI, I.getType()); +- I.replaceAllUsesWith(NewI); +- erase.push_back(&I); ++ abort(); ++ } ++ cast(NewI)->copyMetadata(I); ++ cast(NewI)->copyFastMathFlags(&I); ++ if (NewI->getType() != I.getType()) { ++ NewI = CreateFPCast(Instruction::FPTrunc, NewI, I.getType(), builder); + } ++ I.replaceAllUsesWith(NewI); ++ erase.push_back(&I); + } + } + + +--- src/runtime_intrinsics.c 2022-05-24 16:27:19.292819527 +0000 ++++ src/runtime_intrinsics.c 2022-05-24 16:44:16.062717753 +0000 +@@ -338,9 +338,9 @@ + } + + #define fp_select(a, func) \ +- sizeof(a) == sizeof(float) ? func##f((float)a) : func(a) ++ sizeof(a) <= sizeof(float) ? func##f((float)a) : func(a) + #define fp_select2(a, b, func) \ +- sizeof(a) == sizeof(float) ? func##f(a, b) : func(a, b) ++ sizeof(a) <= sizeof(float) ? func##f(a, b) : func(a, b) + + // fast-function generators // + +@@ -384,11 +384,11 @@ + static inline void name(unsigned osize, void *pa, void *pr) JL_NOTSAFEPOINT \ + { \ + uint16_t a = *(uint16_t*)pa; \ +- float A = __gnu_h2f_ieee(a); \ ++ float A = julia__gnu_h2f_ieee(a); \ + if (osize == 16) { \ + float R; \ + OP(&R, A); \ +- *(uint16_t*)pr = __gnu_f2h_ieee(R); \ ++ *(uint16_t*)pr = julia__gnu_f2h_ieee(R); \ + } else { \ + OP((uint16_t*)pr, A); \ + } \ +@@ -412,11 +412,11 @@ + { \ + uint16_t a = *(uint16_t*)pa; \ + uint16_t b = *(uint16_t*)pb; \ +- float A = __gnu_h2f_ieee(a); \ +- float B = __gnu_h2f_ieee(b); \ ++ float A = julia__gnu_h2f_ieee(a); \ ++ float B = julia__gnu_h2f_ieee(b); \ + runtime_nbits = 16; \ + float R = OP(A, B); \ +- *(uint16_t*)pr = __gnu_f2h_ieee(R); \ ++ *(uint16_t*)pr = julia__gnu_f2h_ieee(R); \ + } + + // float or integer inputs, bool output +@@ -437,8 +437,8 @@ + { \ + uint16_t a = *(uint16_t*)pa; \ + uint16_t b = *(uint16_t*)pb; \ +- float A = __gnu_h2f_ieee(a); \ +- float B = __gnu_h2f_ieee(b); \ ++ float A = julia__gnu_h2f_ieee(a); \ ++ float B = julia__gnu_h2f_ieee(b); \ + runtime_nbits = 16; \ + return OP(A, B); \ + } +@@ -478,12 +478,12 @@ + uint16_t a = *(uint16_t*)pa; \ + uint16_t b = *(uint16_t*)pb; \ + uint16_t c = *(uint16_t*)pc; \ +- float A = __gnu_h2f_ieee(a); \ +- float B = __gnu_h2f_ieee(b); \ +- float C = __gnu_h2f_ieee(c); \ ++ float A = julia__gnu_h2f_ieee(a); \ ++ float B = julia__gnu_h2f_ieee(b); \ ++ float C = julia__gnu_h2f_ieee(c); \ + runtime_nbits = 16; \ + float R = OP(A, B, C); \ +- *(uint16_t*)pr = __gnu_f2h_ieee(R); \ ++ *(uint16_t*)pr = julia__gnu_f2h_ieee(R); \ + } + + +@@ -1001,7 +1001,7 @@ + fpiseq_n(float, 32) + fpiseq_n(double, 64) + #define fpiseq(a,b) \ +- sizeof(a) == sizeof(float) ? fpiseq32(a, b) : fpiseq64(a, b) ++ sizeof(a) <= sizeof(float) ? fpiseq32(a, b) : fpiseq64(a, b) + + bool_fintrinsic(eq,eq_float) + bool_fintrinsic(ne,ne_float) +@@ -1050,7 +1050,7 @@ + if (!(osize < 8 * sizeof(a))) \ + jl_error("fptrunc: output bitsize must be < input bitsize"); \ + else if (osize == 16) \ +- *(uint16_t*)pr = __gnu_f2h_ieee(a); \ ++ *(uint16_t*)pr = julia__gnu_f2h_ieee(a); \ + else if (osize == 32) \ + *(float*)pr = a; \ + else if (osize == 64) \ + +--- src/julia_internal.h 2022-05-24 16:26:09.953046957 +0000 ++++ src/julia_internal.h 2022-05-24 16:28:59.610039708 +0000 +@@ -1427,8 +1427,9 @@ + #define JL_GC_ASSERT_LIVE(x) (void)(x) + #endif + +-float __gnu_h2f_ieee(uint16_t param) JL_NOTSAFEPOINT; +-uint16_t __gnu_f2h_ieee(float param) JL_NOTSAFEPOINT; ++JL_DLLEXPORT float julia__gnu_h2f_ieee(uint16_t param) JL_NOTSAFEPOINT; ++JL_DLLEXPORT uint16_t julia__gnu_f2h_ieee(float param) JL_NOTSAFEPOINT; ++JL_DLLEXPORT uint16_t julia__truncdfhf2(double param) JL_NOTSAFEPOINT; + + #ifdef __cplusplus + } + +--- src/intrinsics.cpp 2022-05-24 17:18:23.008583654 +0000 ++++ src/intrinsics.cpp 2022-05-24 19:56:09.991480454 +0000 +@@ -1633,24 +1633,17 @@ + return h; + } + +-#if !defined(_OS_DARWIN_) // xcode already links compiler-rt +- +-extern "C" JL_DLLEXPORT float __gnu_h2f_ieee(uint16_t param) +-{ +- return half_to_float(param); +-} +- +-extern "C" JL_DLLEXPORT float __extendhfsf2(uint16_t param) ++extern "C" JL_DLLEXPORT float julia__gnu_h2f_ieee(uint16_t param) + { + return half_to_float(param); + } + +-extern "C" JL_DLLEXPORT uint16_t __gnu_f2h_ieee(float param) ++extern "C" JL_DLLEXPORT uint16_t julia__gnu_f2h_ieee(float param) + { + return float_to_half(param); + } + +-extern "C" JL_DLLEXPORT uint16_t __truncdfhf2(double param) ++extern "C" JL_DLLEXPORT uint16_t julia__truncdfhf2(double param) + { + float res = (float)param; + uint32_t resi; +@@ -1671,5 +1664,3 @@ + } + return float_to_half(res); + } +- +-#endif + +--- src/julia.expmap 2022-05-24 16:25:48.787865159 +0000 ++++ src/julia.expmap 2022-05-24 16:28:39.517014539 +0000 +@@ -42,12 +42,6 @@ + environ; + __progname; + +- /* compiler run-time intrinsics */ +- __gnu_h2f_ieee; +- __extendhfsf2; +- __gnu_f2h_ieee; +- __truncdfhf2; +- + local: + *; + }; + +--- src/APInt-C.cpp 2022-05-24 16:25:05.957426445 +0000 ++++ src/APInt-C.cpp 2022-05-24 16:28:27.792411828 +0000 +@@ -316,7 +316,7 @@ + void LLVMFPtoInt(unsigned numbits, void *pa, unsigned onumbits, integerPart *pr, bool isSigned, bool *isExact) { + double Val; + if (numbits == 16) +- Val = __gnu_h2f_ieee(*(uint16_t*)pa); ++ Val = julia__gnu_h2f_ieee(*(uint16_t*)pa); + else if (numbits == 32) + Val = *(float*)pa; + else if (numbits == 64) +@@ -391,7 +391,7 @@ + val = a.roundToDouble(true); + } + if (onumbits == 16) +- *(uint16_t*)pr = __gnu_f2h_ieee(val); ++ *(uint16_t*)pr = julia__gnu_f2h_ieee(val); + else if (onumbits == 32) + *(float*)pr = val; + else if (onumbits == 64) +@@ -408,7 +408,7 @@ + val = a.roundToDouble(false); + } + if (onumbits == 16) +- *(uint16_t*)pr = __gnu_f2h_ieee(val); ++ *(uint16_t*)pr = julia__gnu_f2h_ieee(val); + else if (onumbits == 32) + *(float*)pr = val; + else if (onumbits == 64) diff --git a/trunk/julia-llvm-patchelf.patch b/trunk/julia-llvm-patchelf.patch deleted file mode 100644 index 84feedc299eb..000000000000 --- a/trunk/julia-llvm-patchelf.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/Makefile b/Makefile -index a013747a97..02e566de2e 100644 ---- a/Makefile -+++ b/Makefile -@@ -368,10 +368,6 @@ ifeq ($(BUNDLE_DEBUG_LIBS),1) - endif - endif - -- # Set rpath for LLVM.so which is `$ORIGIN/../lib` moving from `../lib` to `../lib/julia`. We only need to do this for Linux/FreeBSD --ifneq (,$(findstring $(OS),Linux FreeBSD)) -- $(PATCHELF) --set-rpath '$$ORIGIN:$$ORIGIN/$(reverse_private_libdir_rel)' $(DESTDIR)$(private_libdir)/libLLVM.$(SHLIB_EXT) --endif - - - ifneq ($(LOADER_BUILD_DEP_LIBS),$(LOADER_INSTALL_DEP_LIBS))