freebsd-dev/lib/libz/Makefile
Dimitry Andric 152e60f2fe Fix some leftover binaries and shared libraries in the system that still
have an executable stack, due to linking in hand-assembled .S or .s
files, that have no .GNU-stack sections:

RWX --- ---  /lib/libcrypto.so.6
RWX --- ---  /lib/libmd.so.5
RWX --- ---  /lib/libz.so.6
RWX --- ---  /lib/libzpool.so.2
RWX --- ---  /usr/lib/liblzma.so.5

These were found using scanelf, from the sysutils/pax-utils port.

Reviewed by:	kib
2011-02-15 22:03:09 +00:00

70 lines
1.4 KiB
Makefile

#
# $FreeBSD$
#
LIB= z
SHLIBDIR?= /lib
SHLIB_MAJOR= 6
MAN= zlib.3
#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
#CFLAGS=-g -DDEBUG
#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
# -Wstrict-prototypes -Wmissing-prototypes
CFLAGS+= -DHAS_snprintf -DHAS_vsnprintf -I${.CURDIR}
WARNS?= 3
CLEANFILES+= example.o example foo.gz minigzip.o minigzip
SRCS+= adler32.c
SRCS+= compress.c
SRCS+= crc32.c
SRCS+= deflate.c
SRCS+= gzclose.c
SRCS+= gzlib.c
SRCS+= gzread.c
SRCS+= gzwrite.c
SRCS+= infback.c
SRCS+= inffast.c
SRCS+= inflate.c
SRCS+= inftrees.c
SRCS+= trees.c
SRCS+= uncompr.c
SRCS+= zopen.c
SRCS+= zutil.c
.if ${MACHINE_ARCH} == "i386" && ${MACHINE_CPU:M*i686*}
.PATH: ${.CURDIR}/contrib/asm686
SRCS+= match.S
CFLAGS+= -DASMV -DNO_UNDERLINE
ACFLAGS+= -Wa,--noexecstack
.endif
.if ${MACHINE_ARCH} == "amd64"
.PATH: ${.CURDIR}/contrib/gcc_gvmat64
SRCS+= gvmat64.S
CFLAGS+= -DASMV -DNO_UNDERLINE
ACFLAGS+= -Wa,--noexecstack
.endif
VERSION_DEF= ${.CURDIR}/Versions.def
SYMBOL_MAPS= ${.CURDIR}/Symbol.map
CFLAGS+= -DSYMBOL_VERSIONING
INCS= zconf.h zlib.h
minigzip: all minigzip.o
$(CC) -o minigzip minigzip.o -L. -lz
example: all example.o
$(CC) -o example example.o -L. -lz
test: example minigzip
(export LD_LIBRARY_PATH=. ; ./example )
(export LD_LIBRARY_PATH=. ; \
echo hello world | ./minigzip | ./minigzip -d )
.include <bsd.lib.mk>