Build a shared version -- still rather hacky, need to clean up the
Makefileage for shared stuff.
diff --git a/ash/Makefile b/ash/Makefile
index 99ad441..0442db1 100644
--- a/ash/Makefile
+++ b/ash/Makefile
@@ -29,12 +29,16 @@
.c.o:
$(CC) $(CFLAGS) -c -o $@ $<
-all: $(PROG)
+all: $(PROG) $(PROG).shared
$(PROG): $(OBJS) $(LIBS)
$(LD) $(LDFLAGS) -o $(PROG) $(CRT0) $(OBJS) $(LIBS)
$(STRIP) $(PROG)
+$(PROG).shared: $(OBJS) $(LIBS)
+ $(LD) $(LDFLAGS) -o $(PROG).shared -e main $(KLIBSRC)/interp.o $(OBJS) -R $(KLIBSRC)/libc.so $(LIBGCC)
+ $(STRIP) $(PROG).shared
+
$(CRT0) $(LIBS):
@echo '*** error: $@ not up to date' || exit 1
diff --git a/ash/trap.c b/ash/trap.c
index f36c1b0..ce0cdcd 100644
--- a/ash/trap.c
+++ b/ash/trap.c
@@ -325,19 +325,3 @@
#endif
l2: _exit(status);
}
-
-/*
- * Emulation of the BSD signal() call
- */
-__sighandler_t bsd_signal(int signum, __sighandler_t handler)
-{
- struct sigaction act;
- int rv;
-
- memset(&act, 0, sizeof act);
- act.sa_handler = handler;
- act.sa_flags = SA_RESTART;
-
- return sigaction(signum, &act, &act)
- ? SIG_ERR : act.sa_handler;
-}
diff --git a/ash/trap.h b/ash/trap.h
index a7d18d2..cdb604b 100644
--- a/ash/trap.h
+++ b/ash/trap.h
@@ -48,7 +48,6 @@
void dotrap(void);
void setinteractive(int);
void exitshell(int);
-__sighandler_t bsd_signal(int, __sighandler_t);
#else
void clear_traps();
int setsignal();