Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfault when compiling statically linked binary #9

Closed
KJ4TIP opened this issue Jul 22, 2018 · 1 comment
Closed

Segfault when compiling statically linked binary #9

KJ4TIP opened this issue Jul 22, 2018 · 1 comment

Comments

@KJ4TIP
Copy link

KJ4TIP commented Jul 22, 2018

When compiling the latest git version as of the time of writing (commit 24452ce), the resulting sbl binary throws a segmentation fault upon running (even running with no arguments). Removing -static from CFLAGS appears to fix the problem. See patch below

diff --git a/makefile b/makefile
index e771c79..a2e1921 100644
--- a/makefile
+++ b/makefile
@@ -24,7 +24,7 @@ OSINT=./osint
 vpath %.c $(OSINT)
 
 ifeq   ($(DEBUG),0)
-CFLAGS= -D m64 -m64 -static 
+CFLAGS= -D m64 -m64
 else
 CFLAGS= -D m64 -g -m64
 endif
@@ -102,11 +102,11 @@ OBJS=     $(AOBJS) $(COBJS) $(HOBJS) $(LOBJS) $(SYSOBJS) $(VOBJS) $(MOBJS) $(NAOBJS)
 # link spitbol with static linking
 LIBS = 
 
-sbl: $(OBJS)
-       $(CC) $(CFLAGS) $(LIBS) -lm $(OBJS) -osbl
+#sbl: $(OBJS)
+#      $(CC) $(CFLAGS) $(LIBS) -lm $(OBJS) -osbl
 
 # link spitbol with dynamic linking
-spitbol-dynamic: $(OBJS)
+sbl: $(OBJS)
        $(CC) $(CFLAGS) $(OBJS) $(LIBS) -lm -osbl 
 
 # Assembly language dependencies:
@CheyenneWills
Copy link
Contributor

I know that this is an old issue.

Static linking seems to be be okay with the latest master / and the new development branch.

The dynamic linking appears to be broken and I haven't investigated it yet.

I'm going to close this issue and if the problem still exists, a new issue can be opened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants