Code Monkey home page Code Monkey logo

Comments (10)

fionafibration avatar fionafibration commented on August 22, 2024 2

Ok, I found them, they're in movfuscator/lcc/etc/lcc.c for anyone else looking for them.

from movfuscator.

easyaspi314 avatar easyaspi314 commented on August 22, 2024

This is because of __restrict not being accepted by lcc. Defining it to empty fixes the issue.

from movfuscator.

fubuki8087 avatar fubuki8087 commented on August 22, 2024

This is because of __restrict not being accepted by lcc. Defining it to empty fixes the issue.

Could you please introduce the steps more detail? I don't know how to operate. Thanks!

from movfuscator.

easyaspi314 avatar easyaspi314 commented on August 22, 2024
diff --git a/etc/linux.c b/etc/linux.c
index 5df6059..e9e4a82 100755
--- a/etc/linux.c
+++ b/etc/linux.c
@@ -12,23 +12,23 @@ char *suffixes[] = { ".c", ".i", ".s", ".o", ".out", 0 };
 char inputs[256] = "";
 char *cpp[] = { LCCDIR "gcc/cpp",
        "-U__GNUC__", "-D_POSIX_SOURCE", "-D__STDC__=1", "-D__STRICT_ANSI__",
-       "-Dunix", "-Di386", "-Dlinux",
+       "-Dunix", "-Di386", "-Dlinux", "-D__restrict=", "-std=c89", "-Drestrict=",
        "-D__unix__", "-D__i386__", "-D__linux__", "-D__signed__=signed",
        "$1", "$2", "$3", 0 };
 char *include[] = {"-I" LCCDIR "include", "-I" LCCDIR "gcc/include", "-I/usr/include", 0 };

You have to modify the build.sh to keep it from resetting lcc.

diff --git a/build.sh b/build.sh
index a5daed1..a38669c 100755
--- a/build.sh
+++ b/build.sh
@@ -3,8 +3,8 @@
 set -v
 
 # grab the frontend
[ ! -d "lcc" ] && git clone https://github.com/drh/lcc
-cd lcc && git reset --hard 3b3f01b4103cd7b519ae84bd1122c9b03233e687 && cd -
+# cd lcc && git reset --hard 3b3f01b4103cd7b519ae84bd1122c9b03233e687 && cd -
 
 # create a build directory
 export BUILDDIR=`pwd`/build

from movfuscator.

fubuki8087 avatar fubuki8087 commented on August 22, 2024

I've tried to operate as you said, but the problem still exists. However, when I use movcc to compile my source file by manually adding parameter -D__restrict= and -Drestrict=, it can works.

from movfuscator.

easyaspi314 avatar easyaspi314 commented on August 22, 2024
diff --git a/etc/lcc.c b/etc/lcc.c
index 95b621a..04a80c3 100755
--- a/etc/lcc.c
+++ b/etc/lcc.c
@@ -100,6 +100,8 @@ main(int argc, char *argv[]) {
                exit(0);
        }
        plist = append("-D__LCC__", 0);
+       plist = append("-D__restrict=", 0);
+       plist = append("-Drestrict=", 0);
        initinputs();
        if (getenv("LCCDIR"))
                option(stringf("-lccdir=%s", getenv("LCCDIR")));

from movfuscator.

fubuki8087 avatar fubuki8087 commented on August 22, 2024

OK, it works! Thank you very much!

from movfuscator.

MrAureliusR avatar MrAureliusR commented on August 22, 2024

Having this error still. After issue #19 was resolved, if I follow the steps here to fix this error, any binary built with movcc segfaults. Before #19 was fixed, I could follow the steps here and get a working compiler, but I just couldn't use --no-mov-flow. Now, even when not using --no-mov-flow, I'm just getting segfaults with anything I try and compile.

from movfuscator.

fionafibration avatar fionafibration commented on August 22, 2024

I've tried to fix this, but I can't find the files for the DIFF you're referencing.

from movfuscator.

MrAureliusR avatar MrAureliusR commented on August 22, 2024

@ThePlasmaRailgun They are in the lcc/ subfolder, except for build.sh which is in the top folder.

from movfuscator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.