sgxwallet icon indicating copy to clipboard operation
sgxwallet copied to clipboard

Error when building

Open 20urc3 opened this issue 9 months ago • 6 comments

Describe the bug An error occur when building sgxwallet dependencies with cd scripts; ./build_deps.py; cd .. gcc: error: unrecognized command line option ‘-m486’

20urc3 avatar Sep 19 '23 16:09 20urc3

hey @20urc3 ! could you please specify which part of the script failed?

olehnikolaiev avatar Sep 19 '23 16:09 olehnikolaiev

Sure, when building dependencies with the scripts build_deps.py (in /scripts) it errors gcc: error: unrecognized command line option ‘-m486’

In /sgxwallet/sgx-gmp/mpn/Makefile There is the line CFLAGS_CPU = -mtune=k8 -mcpu=athlon -mcpu=pentiumpro -mcpu=i486 -m486

-m486 is outdated since a very longtime, just remove it.

However, the problem persist.

20urc3 avatar Sep 19 '23 16:09 20urc3

It seems that running the script is creating the makefile in sgx-gmp, thus adding again the problematic line "-m486"

20urc3 avatar Sep 19 '23 17:09 20urc3

The exact part of the script that create issue:

assert subprocess.call(["bash", "-c", "./configure --prefix=" + TGMP_BUILD_DIR + " --disable-shared --enable-static --with-pic --enable-sgx --with-sgxsdk=" + SDK_DIR + "/sgxsdk"]>
assert subprocess.call(["make", "install"]) == 0
assert subprocess.call(["make", "clean"]) == 0

20urc3 avatar Sep 19 '23 17:09 20urc3

My workaround was to comment the part i mentionned above. Then i use this command to remove "-m486" from configure and makefile: sed -i 's/-m486//g' filename and then I run that script inside sgx-gmp instead:

import sys
import os
import subprocess

os.chdir("..")
topDir = os.getcwd()
os.chdir("sgx-gmp")

TGMP_BUILD_DIR = topDir + "/tgmp-build"
SDK_DIR = topDir + "/sgx-sdk-build"

assert subprocess.call(["bash", "-c", "./configure --prefix=" + TGMP_BUILD_DIR + " --disable-shared --enable-static --with-pic --enable-sgx --with-sgxsdk=" + SDK_DIR + "/sgxsdk"]) == 0
assert subprocess.call(["make", "install"]) == 0
assert subprocess.call(["make", "clean"]) == 0

20urc3 avatar Sep 19 '23 17:09 20urc3

@20urc3 sorry I wasn't able to reproduce your issue yet. could you please tell what is your machine configuration? uname -a and lsb_release -a

olehnikolaiev avatar Sep 29 '23 15:09 olehnikolaiev