mcl icon indicating copy to clipboard operation
mcl copied to clipboard

Added makefile command for creating /src/asm/bint$BIT.ll-$ARCH.s files

Open mxaddict opened this issue 3 years ago • 1 comments

Related to https://github.com/herumi/mcl/issues/153

mxaddict avatar Sep 22 '22 01:09 mxaddict

@herumi I've created this build step that can create asm files as needed, could you give this a test?

mxaddict avatar Sep 22 '22 01:09 mxaddict

@herumi have you had a moment to check this?

mxaddict avatar Sep 27 '22 16:09 mxaddict

Sorry, I have to save my job because I got a bad headache. I'll check it little by little.

herumi avatar Sep 27 '22 21:09 herumi

Sorry, I have to save my job because I got a bad headache. I'll check it little by little.

No worries 👍🏼

mxaddict avatar Sep 27 '22 23:09 mxaddict

Now the name of a generated asm from bint$(BIT).ll is generically src/asm/bint$(BIT)-$(OS)-$(CPU). But the name in your patch is bint$(BIT)-$(CPU). I append $(OS) to distinguish M1 Mac and AArch64 Linux / x64 Linux and x64 Windows. Don't you think that's necessary? If so, how about src/bint-$(TARGET) -target $(TARGET)? It is simple.

herumi avatar Sep 28 '22 04:09 herumi

Which do you need, lib/libmcl.a or lib/bn384_256.a ?

herumi avatar Sep 28 '22 08:09 herumi

we need lib/libmcl.a to link against herumi/bls

mxaddict avatar Sep 28 '22 22:09 mxaddict

I'm not sure actually, cause I noticed that linux aarch64 and mac arm64 when creating the asm files had the same results when using the same clang versions. so I think they are interchangeable.

mxaddict avatar Sep 28 '22 22:09 mxaddict

I'm not sure actually, cause I noticed that linux aarch64 and mac arm64 when creating the asm files had the same results when using the same clang versions. so I think they are interchangeable.

I think we might need to do more investigation

mxaddict avatar Sep 28 '22 22:09 mxaddict

we need lib/libmcl.a to link against herumi/bls

Then, I think that it is better to modify bls/Makefile.onelib . I'll let it support cross-compile.

herumi avatar Sep 29 '22 00:09 herumi

Would this mean compiling bls, but without having a libmcl.a ?

mxaddict avatar Sep 29 '22 03:09 mxaddict

Would this mean compiling bls, but without having a libmcl.a ?

At first, libmcl.a was developed separately. But for convenience of libbls, it contains libmcl.a in bls-eth-go-binary. It is not so good, but it remains for backward compatibility. bls/Makefile.one lib is to make the library.

https://github.com/herumi/bls/blob/dev/Makefile.onelib#L180-L186 seems to be able to make libbls384_256.a for aarch64 and i686 on x86-64 Linux. Could you check it? If it is okay, I'll add the other configuration.

herumi avatar Sep 29 '22 06:09 herumi

Would this mean compiling bls, but without having a libmcl.a ?

At first, libmcl.a was developed separately. But for convenience of libbls, it contains libmcl.a in bls-eth-go-binary. It is not so good, but it remains for backward compatibility. bls/Makefile.one lib is to make the library.

https://github.com/herumi/bls/blob/dev/Makefile.onelib#L180-L186 seems to be able to make libbls384_256.a for aarch64 and i686 on x86-64 Linux. Could you check it? If it is okay, I'll add the other configuration.

I'll check it out.

mxaddict avatar Sep 29 '22 09:09 mxaddict

This command is https://github.com/herumi/mcl/blob/master/Makefile#L189-L190

$(BINT_SRC): src/bint$(BIT).ll
	$(CLANG) -S $< -o $@ -no-integrated-as -fpic -O2 -DNDEBUG -Wall -Wextra $(CLANG_TARGET) $(CFLAGS_USER)

herumi avatar Dec 20 '22 00:12 herumi