multicore-locks / litl

LiTL: Library for Transparent Lock Interposition
MIT License
75 stars 21 forks source link

Compile Litl library on ARM architecture #5

Open SpicySoupDKQ opened 2 years ago

SpicySoupDKQ commented 2 years ago

Hi @HugoGuiroux I'm trying to compile Litl library on ARM architecture and replace #include header file with sse2neon (sse2neon see https://github.com/DLTcollab/sse2neon/) The error encountered in CLHT/include/atiomic_ops.h is as follows: error: impossible constraint in ‘asm’ asm volatile("xchgb %0,%1" How to solve the above problems to complete the compilation and operation of Litl on the ARM architecture. Please let me know if you have a solution, thanks a lot.

goldsteinn commented 2 years ago

Hi @HugoGuiroux I'm trying to compile Litl library on ARM architecture and replace #include header file with sse2neon (sse2neon see https://github.com/DLTcollab/sse2neon/) The error encountered in CLHT/include/atiomic_ops.h is as follows: error: impossible constraint in ‘asm’ asm volatile("xchgb %0,%1" How to solve the above problems to complete the compilation and operation of Litl on the ARM architecture. Please let me know if you have a solution, thanks a lot.

Thats x86_64 inline assembly. This library is not really portable cross arch. Your going to have to at the very least replace all the inline assembly with the corresponding aarch64 code and probably fix a litany of bugs due missing memory barriers.

Edit: If you do go about porting this to aarch64 can you ping back here with the fork?

SpicySoupDKQ commented 2 years ago

Hi @HugoGuiroux I'm trying to compile Litl library on ARM architecture and replace #include header file with sse2neon (sse2neon see https://github.com/DLTcollab/sse2neon/) The error encountered in CLHT/include/atiomic_ops.h is as follows: error: impossible constraint in ‘asm’ asm volatile("xchgb %0,%1" How to solve the above problems to complete the compilation and operation of Litl on the ARM architecture. Please let me know if you have a solution, thanks a lot.

Thats x86_64 inline assembly. This library is not really portable cross arch. Your going to have to at the very least replace all the inline assembly with the corresponding aarch64 code and probably fix a litany of bugs due missing memory barriers.

Edit: If you do go about porting this to aarch64 can you ping back here with the fork?

I have solved the above problems, compiled and generated .sh files, but reported errors during use 'undefined symbol: CAS_U64' Similar errors are as follows: 'undefined symbol: PREFETCHW' 'undefined symbol: getticks' 'undefined symbol: _mm_mfence' 'undefined symbol: FAI_U32' I tried to modify the following 'platform-specific definitions' in line 205 in litl/obj/CLTH/ssmem/include/ssmem.h to define the corresponding functions according to the ARM architecture But the error is still not resolved

goldsteinn commented 2 years ago

The runtime errors are because the code is compiled down to a shared library and its expecting to find those symbols in the executable your running.

You need to find where each of them is defined and re-define them with the corresponding aarch64 instructions.

SpicySoupDKQ commented 2 years ago

The runtime errors are because the code is compiled down to a shared library and its expecting to find those symbols in the executable your running.

You need to find where each of them is defined and re-define them with the corresponding aarch64 instructions.

Thanks, the problem has been solved

SpicySoupDKQ commented 2 years ago

Edit: If you do go about porting this to aarch64 can you ping back here with the fork? Hi @goldsteinn,I've done porting code from x86 to ARM,But it includes modifications to ssmem and sspfd under CLHT. If I upload a new branch, the above two libraries will also be uploaded together

goldsteinn commented 2 years ago

I see, any chance you can post the patches from master/HEAD or just push a fork without those two library and references to the versions?

If not cest la vie.

iamqk commented 1 year ago

The runtime errors are because the code is compiled down to a shared library and its expecting to find those symbols in the executable your running. You need to find where each of them is defined and re-define them with the corresponding aarch64 instructions.

Thanks, the problem has been solved

Would you please kindly share your _mm_mfence implement file?

iamqk commented 1 year ago

https://github.com/DLTcollab/sse2neon/issues/554#issuecomment-1328657516

problem sovled