Comments (9)
Thanks for the report. In src/conc/Interlocked.hpp
, line 328, could you try to replace:
static_assert (
__atomic_always_lock_free (sizeof (dest), nullptr),
"128-bit atomic operations are not lock-free"
);
old = comp;
__atomic_compare_exchange_n (
&dest, &old, excg,
false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST
);
with:
old = __sync_val_compare_and_swap (&dest, comp, excg);
and tell me if it works better? Thanks
You could also try with clang: configure --enable-clang
from fmtconv.
This patch is correct ? If yes this doesn't build. See the build error after the patch ?
--- fmtconv-dmo-27.orig/src/conc/Interlocked.hpp
+++ fmtconv-dmo-27/src/conc/Interlocked.hpp
@@ -325,7 +325,7 @@ void Interlocked::cas (Data128 &old, vol
#elif defined (__GNUC__)
- static_assert (
+ old = __sync_val_compare_and_swap (&dest, comp, excg);
__atomic_always_lock_free (sizeof (dest), nullptr),
"128-bit atomic operations are not lock-free"
);
GCC output.
libtool: compile: g++ -DPACKAGE_NAME=\"fmtconv\" -DPACKAGE_TARNAME=\"fmtconv\" -DPACKAGE_VERSION=\"r27\" "-DPACKAGE_STRING=\"fmtconv r27\"" "-DPACKAGE_BUGREPORT=\"http://forum.doom9.org/showthread.php?t=166504\"" "-DPACKAGE_URL=\"http://forum.doom9.org/showthread.php?t=166504\"" -DHAVE_STDIO_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I. -Wdate-time -D_FORTIFY_SOURCE=2 -std=c++14 -O3 -g3 -DNDEBUG -mfpmath=sse -msse2 -mcx16 -Wall -Wextra -Wshadow -Wunused -Wnull-dereference -Wvla -Wstrict-aliasing -Wuninitialized -Wunused-parameter -Wreorder -Wsign-compare -Wunreachable-code -Wconversion -Wno-sign-conversion -Wredundant-decls -Wno-ignored-attributes -Wno-expansion-to-defined -I./../../src -g -O2 -ffile-prefix-map=/home/marillat/src/fmtconv-27=. -fstack-protector-strong -Wformat -Werror=format-security -c ../../src/fmtcl/Dither.cpp -fPIC -DPIC -o ../../src/fmtcl/.libs/Dither.o
In file included from ./../../src/conc/Interlocked.h:132,
from ./../../src/conc/AtomicPtr.hpp:27,
from ./../../src/conc/AtomicPtr.h:123,
from ./../../src/conc/CellPool.h:30,
from ./../../src/conc/ObjPool.h:44,
from ./../../src/fmtcl/Dither.h:26,
from ../../src/fmtcl/Dither.cpp:29:
./../../src/conc/Interlocked.hpp: In static member function 'static void conc::Interlocked::cas(conc::Interlocked::Data128&, volatile Data128&, const Data128&, const Data128&)':
./../../src/conc/Interlocked.hpp:329:43: warning: left operand of comma operator has no effect [-Wunused-value]
329 | __atomic_always_lock_free (sizeof (dest), nullptr),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
./../../src/conc/Interlocked.hpp:330:62: error: expected ';' before ')' token
330 | "128-bit atomic operations are not lock-free"
| ^
| ;
331 | );
| ~
./../../src/conc/Interlocked.hpp:331:10: warning: right operand of comma operator has no effect [-Wunused-value]
331 | );
| ^
make: *** [Makefile:1779: ../../src/fmtcl/Dither.lo] Error 1
from fmtconv.
Well me be the patch is supposed to be this one ?
--- a/src/conc/Interlocked.hpp
+++ b/src/conc/Interlocked.hpp
@@ -325,15 +325,7 @@ void Interlocked::cas (Data128 &old, vol
#elif defined (__GNUC__)
- static_assert (
- __atomic_always_lock_free (sizeof (dest), nullptr),
- "128-bit atomic operations are not lock-free"
- );
- old = comp;
- __atomic_compare_exchange_n (
- &dest, &old, excg,
- false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST
- );
+ old = __sync_val_compare_and_swap (&dest, comp, excg);
#else
from fmtconv.
Yes, the second one.
from fmtconv.
This fix this issue for amd64, arm64, armhf and i 86 arches but fail with armel for gcc and clang.
libtool: compile: clang++ -DPACKAGE_NAME=\"fmtconv\" -DPACKAGE_TARNAME=\"fmtconv\" -DPACKAGE_VERSION=\"r27\" "-DPACKAGE_STRING=\"fmtconv r27\"" "-DPACKAGE_BUGREPORT=\"http://forum.doom9.org/showthread.php?t=166504\"" "-DPACKAGE_URL=\"http://forum.doom9.org/showthread.php?t=166504\"" -DHAVE_STDIO_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I. -Wdate-time -D_FORTIFY_SOURCE=2 -std=c++14 -O3 -g3 -DNDEBUG -ftree-vectorize -mfpu=neon -Wall -Wextra -Wshadow -Wunused -Wnull-dereference -Wvla -Wstrict-aliasing -Wuninitialized -Wunused-parameter -Wreorder -Wsign-compare -Wunreachable-code -Wconversion -Wno-sign-conversion -Wshadow-all -Wshorten-64-to-32 -Wint-conversion -Wconditional-uninitialized -Wconstant-conversion -Wunused-private-field -Wbool-conversion -Wextra-semi -Wnullable-to-nonnull-conversion -Wno-unused-private-field -Wno-unused-command-line-argument -I./../../src -g -O2 -ffile-prefix-map=/home/marillat/fmtconv-dmo-27=. -fstack-protector-strong -Wformat -Werror=format-security -c ../../src/fmtcl/Dither.cpp -fPIC -DPIC -o ../../src/fmtcl/.libs/Dither.o
In file included from ../../src/fmtcl/Dither.cpp:29:
In file included from ./../../src/fmtcl/Dither.h:26:
In file included from ./../../src/conc/ObjPool.h:44:
In file included from ./../../src/conc/CellPool.h:33:
In file included from ./../../src/conc/LockFreeStack.h:45:
In file included from ./../../src/conc/AtomicPtrIntPair.h:40:
In file included from ./../../src/conc/Interlocked.h:132:
./../../src/conc/Interlocked.hpp:105:2: error: static_assert failed due to requirement '__atomic_always_lock_free(sizeof (dest), nullptr)' "32-bit atomic operations are not lock-free"
static_assert (
^
./../../src/conc/Interlocked.hpp:223:2: error: static_assert failed due to requirement '__atomic_always_lock_free(sizeof (dest), nullptr)' "64-bit atomic operations are not lock-free"
static_assert (
^
2 errors generated.
make: *** [Makefile:1779: ../../src/fmtcl/Dither.lo] Error 1
from fmtconv.
Thank you so much for the testing. It seems armel architecture doesn’t have lock-free primitives, so I think I’ll just remove the static_assert()
so the compiler will make use of the non-lock-free fallback. This will be sub-optimal but should work.
from fmtconv.
master commit 3a78392 fail to build for arm64
ERROR: compile ../../src/fmtcl/Dither.cpp on localhost failed
In file included from ./../../src/conc/Interlocked.h:132,
from ./../../src/conc/AtomicPtrIntPair.h:40,
from ./../../src/conc/LockFreeStack.h:45,
from ./../../src/conc/CellPool.h:33,
from ./../../src/conc/ObjPool.h:44,
from ./../../src/fmtcl/Dither.h:26,
from ../../src/fmtcl/Dither.cpp:29:
./../../src/conc/Interlocked.hpp: In static member function 'static void conc::Interlocked::cas(conc::Interlocked::Data128&, volatile Data128&, const Data128&, const Data128&)':
./../../src/conc/Interlocked.hpp:335:51: error: static assertion failed: 128-bit atomic operations are not lock-free
335 | __atomic_always_lock_free (sizeof (dest), nullptr),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
make: *** [Makefile:1805: ../../src/fmtcl/Dither.lo] Error 1
from fmtconv.
The hell… Is 86d5b90 better?
from fmtconv.
Yes, build for all arches.
from fmtconv.
Related Issues (20)
- Segfault on FreeBSD - debug build has undefined symbol at runtime HOT 2
- Problem with spline16 HOT 9
- "cannot find avstp.dll.Usage restricted to single threading" debug message in vapoursynth HOT 3
- bitdepth() does not set _ColorRange property after conversion HOT 3
- Matrix col_fam and the cm* constants in future VS versions HOT 8
- r24 fails to build on IA32 (32-bit x86) HOT 2
- cplaced (avs+) HOT 2
- vapoursynth.Error: transfer: Function does not take argument(s) named logceis, logceid HOT 1
- Matrix will raise error when convert between RGB and OPP HOT 1
- matrix: unsupported color family for output. HOT 1
- transfer: Vapoursynth crash when use r26 HOT 1
- Feature request: convert YV12 interlaced <--> YV12 progressive HOT 3
- Fail to build on m1 macOS. HOT 3
- error: '_mm_storeu_si32' was not declared in this scope; did you mean '_mm_storeu_si64'? HOT 3
- Does not work correctly on Apple Silicon after successful compilation HOT 7
- recipe for target '../../src/fmtcl/libavx2_la-TransLut_avx2.lo' failed HOT 2
- Typo in src/fstb/Vu32.hpp HOT 1
- Catch i14 input in fmtc.resample HOT 2
- ARRI LogC4 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fmtconv.