Skip to content

Commit

Permalink
fix compilation, stripping, symbol issues
Browse files Browse the repository at this point in the history
  • Loading branch information
squeaky-pl committed Nov 3, 2018
1 parent 1f6ad68 commit 29c9bc9
Showing 4 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions misc/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -4,3 +4,4 @@ psutil==5.4.7
pytest==3.9.2
pytoml==0.1.20
perf==1.5.1
cffi==1.11.5
2 changes: 1 addition & 1 deletion src/japronto/__init__.py
Original file line number Diff line number Diff line change
@@ -2,4 +2,4 @@
from .router import RouteNotFoundException # noqa


__version__ = '0.1.1'
__version__ = '0.1.2a'
9 changes: 7 additions & 2 deletions src/japronto/parser/build_libpicohttpparser.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
import distutils.log
distutils.log.set_verbosity(distutils.log.DEBUG)

import os.path

import cffi
ffibuilder = cffi.FFI()

shared_path = os.path.abspath(os.path.join(os.path.dirname(__file__),
'../picohttpparser'))
'../../picohttpparser'))

print(shared_path)

ffibuilder.set_source("libpicohttpparser", """
#include "picohttpparser.h"
""", libraries=['picohttpparser'], include_dirs=[shared_path],
library_dirs=[shared_path],
# extra_objects=[os.path.join(shared_path, 'picohttpparser.o')],
extra_link_args=['-Wl,-rpath=' + shared_path])

# extra_objects=[os.path.join(shared_path, 'picohttpparser.o')],
# or a list of libraries to link with
# (more arguments like setup.py's Extension class:
# include_dirs=[..], extra_objects=[..], and so on)
11 changes: 3 additions & 8 deletions src/picohttpparser/build
Original file line number Diff line number Diff line change
@@ -2,11 +2,6 @@

set -ex

gcc -c picohttpparser.c -O3 -fpic -msse4.2
gcc -shared -o libpicohttpparser.so picohttpparser.o
if [[ `uname` == "Darwin" ]]
then
strip -x libpicohttpparser.so
else
strip libpicohttpparser.so
fi
gcc -c picohttpparser.c -O3 -fPIC -msse4.2 -o ssepicohttpparser.o
gcc -c picohttpparser.c -O3 -fPIC -o picohttpparser.o
gcc -fPIC -shared -o libpicohttpparser.so picohttpparser.o ssepicohttpparser.o

0 comments on commit 29c9bc9

Please sign in to comment.