]> Sergey Matveev's repositories - nnn.git/commitdiff
Revert non-portable optimization
authorArun Prakash Jana <engineerarun@gmail.com>
Sun, 2 Apr 2017 02:45:07 +0000 (08:15 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Sun, 2 Apr 2017 02:53:13 +0000 (08:23 +0530)
Makefile
README.md
nnn.c

index 542278568dfd5f0ae860c367da32950ad17ad6cc..e971355b339bafba1bac675e8373b960d44352c8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -5,8 +5,7 @@ MANPREFIX = $(PREFIX)/man
 
 #CPPFLAGS = -DDEBUG
 #CFLAGS = -g
-CFLAGS = -O3 -march=native -fno-asynchronous-unwind-tables -fdata-sections \
-    -ffunction-sections -Wl,--gc-sections
+CFLAGS = -O3 -march=native -s
 LDLIBS = -lcurses
 
 DISTFILES = nnn.c strlcat.c strlcpy.c util.h config.def.h \
@@ -18,9 +17,6 @@ all: $(BIN)
 
 $(BIN): $(OBJ)
        $(CC) $(CFLAGS) -o $@ $(OBJ) $(LDFLAGS) $(LDLIBS)
-       strip -S --strip-unneeded --remove-section=.note.gnu.gold-version \
-    --remove-section=.comment --remove-section=.note \
-    --remove-section=.note.gnu.build-id --remove-section=.note.ABI-tag $(BIN)
 
 nnn.o: util.h config.h
 strlcat.o: util.h
@@ -47,4 +43,4 @@ dist:
        rm -rf nnn-$(VERSION)
 
 clean:
-       rm -f config.h $(BIN) $(OBJ) nnn-$(VERSION).tar.gz
+       rm -f $(BIN) $(OBJ) nnn-$(VERSION).tar.gz
index 0d9b83499e045b52e4b0828cdb613690067de07a..b8f7d92b47eb19558a29672739c4445be91e627d 100644 (file)
--- a/README.md
+++ b/README.md
@@ -82,7 +82,6 @@ I chose to fork because:
   - Simplified some roundabout procedures
   - `-O3` level optimization, warning fixes
   - Added compilation flag `-march=native`
-  - Massive binary size optimization
   - Remove generated config.h on `make clean`
   - strip the final binary
 
diff --git a/nnn.c b/nnn.c
index bc2583cb9a84b50324c93a70e4d75c5bc71b7b86..aa8dd5652153050a26390aa5153e8edcf2e10123 100644 (file)
--- a/nnn.c
+++ b/nnn.c
 
 #ifdef DEBUG
 #define DEBUG_FD 8
-#define DPRINTF_D(x) dprintf(DEBUG_FD, #x "=%d\n", x)
-#define DPRINTF_U(x) dprintf(DEBUG_FD, #x "=%u\n", x)
-#define DPRINTF_S(x) dprintf(DEBUG_FD, #x "=%s\n", x)
-#define DPRINTF_P(x) dprintf(DEBUG_FD, #x "=0x%p\n", x)
+#define DPRINTF_D(x) xprintf(DEBUG_FD, #x "=%d\n", x)
+#define DPRINTF_U(x) xprintf(DEBUG_FD, #x "=%u\n", x)
+#define DPRINTF_S(x) xprintf(DEBUG_FD, #x "=%s\n", x)
+#define DPRINTF_P(x) xprintf(DEBUG_FD, #x "=0x%p\n", x)
 #else
 #define DPRINTF_D(x)
 #define DPRINTF_U(x)
@@ -118,9 +118,8 @@ static void printmsg(char *);
 static void printwarn(void);
 static void printerr(int, char *);
 
-#undef dprintf
 static int
-dprintf(int fd, const char *fmt, ...)
+xprintf(int fd, const char *fmt, ...)
 {
        char buf[BUFSIZ];
        int r;