Explorar el Código

Revert non-portable optimization

master
Arun Prakash Jana hace 8 años
padre
commit
90e98b832b
No se encontró ninguna clave conocida en la base de datos para esta firma ID de clave GPG: A75979F35C080412
Se han modificado 3 ficheros con 7 adiciones y 13 borrados
  1. +2
    -6
      Makefile
  2. +0
    -1
      README.md
  3. +5
    -6
      nnn.c

+ 2
- 6
Makefile Ver fichero

@@ -5,8 +5,7 @@ MANPREFIX = $(PREFIX)/man


#CPPFLAGS = -DDEBUG #CPPFLAGS = -DDEBUG
#CFLAGS = -g #CFLAGS = -g
CFLAGS = -O3 -march=native -fno-asynchronous-unwind-tables -fdata-sections \
-ffunction-sections -Wl,--gc-sections
CFLAGS = -O3 -march=native -s
LDLIBS = -lcurses LDLIBS = -lcurses


DISTFILES = nnn.c strlcat.c strlcpy.c util.h config.def.h \ DISTFILES = nnn.c strlcat.c strlcpy.c util.h config.def.h \
@@ -18,9 +17,6 @@ all: $(BIN)


$(BIN): $(OBJ) $(BIN): $(OBJ)
$(CC) $(CFLAGS) -o $@ $(OBJ) $(LDFLAGS) $(LDLIBS) $(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 nnn.o: util.h config.h
strlcat.o: util.h strlcat.o: util.h
@@ -47,4 +43,4 @@ dist:
rm -rf nnn-$(VERSION) rm -rf nnn-$(VERSION)


clean: clean:
rm -f config.h $(BIN) $(OBJ) nnn-$(VERSION).tar.gz
rm -f $(BIN) $(OBJ) nnn-$(VERSION).tar.gz

+ 0
- 1
README.md Ver fichero

@@ -82,7 +82,6 @@ I chose to fork because:
- Simplified some roundabout procedures - Simplified some roundabout procedures
- `-O3` level optimization, warning fixes - `-O3` level optimization, warning fixes
- Added compilation flag `-march=native` - Added compilation flag `-march=native`
- Massive binary size optimization
- Remove generated config.h on `make clean` - Remove generated config.h on `make clean`
- strip the final binary - strip the final binary




+ 5
- 6
nnn.c Ver fichero

@@ -22,10 +22,10 @@


#ifdef DEBUG #ifdef DEBUG
#define DEBUG_FD 8 #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 #else
#define DPRINTF_D(x) #define DPRINTF_D(x)
#define DPRINTF_U(x) #define DPRINTF_U(x)
@@ -118,9 +118,8 @@ static void printmsg(char *);
static void printwarn(void); static void printwarn(void);
static void printerr(int, char *); static void printerr(int, char *);


#undef dprintf
static int static int
dprintf(int fd, const char *fmt, ...)
xprintf(int fd, const char *fmt, ...)
{ {
char buf[BUFSIZ]; char buf[BUFSIZ];
int r; int r;


Cargando…
Cancelar
Guardar