File nginx-1.4.2-passenger_fix.patch of Package nginx
diff -Nru nginx-1.4.2.orig/passenger/build/common_library.rb nginx-1.4.2/passenger/build/common_library.rb
--- nginx-1.4.2.orig/passenger/build/common_library.rb 2013-08-05 22:44:31.000000000 +0200
+++ nginx-1.4.2/passenger/build/common_library.rb 2013-08-14 08:19:14.405511929 +0200
@@ -34,7 +34,7 @@
# Defines tasks for compiling a static library containing Boost and OXT.
def define_libboost_oxt_task(namespace, output_dir, extra_compiler_flags = nil)
output_file = "#{output_dir}.a"
- flags = "-Iext #{extra_compiler_flags} #{PlatformInfo.portability_cflags} #{EXTRA_CXXFLAGS}"
+ flags = "-Iext #{extra_compiler_flags} #{PlatformInfo.portability_cflags} #{EXTRA_CXXFLAGS} -fPIC #{ENV['RPM_OPT_FLAGS']} "
if false && boolean_option('RELEASE')
# Disable RELEASE support. Passenger Standalone wants to link to the
@@ -126,7 +126,7 @@
]
file LIBEV_OUTPUT_DIR + "Makefile" => dependencies do
# Disable all warnings: http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod#COMPILER_WARNINGS
- cflags = "#{EXTRA_CXXFLAGS} -w"
+ cflags = "#{EXTRA_CXXFLAGS} #{ENV['RPM_OPT_FLAGS']} -w"
sh "mkdir -p #{LIBEV_OUTPUT_DIR}" if !File.directory?(LIBEV_OUTPUT_DIR)
sh "cd #{LIBEV_OUTPUT_DIR} && sh #{LIBEV_SOURCE_DIR}configure " +
"--disable-shared --enable-static CFLAGS='#{cflags}' orig_CFLAGS=1"
@@ -174,7 +174,7 @@
file LIBEIO_OUTPUT_DIR + "Makefile" => dependencies do
# Disable all warnings. The author has a clear standpoint on that:
# http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod#COMPILER_WARNINGS
- cflags = "#{EXTRA_CXXFLAGS} -w"
+ cflags = "#{EXTRA_CXXFLAGS} #{ENV['RPM_OPT_FLAGS']} -w"
sh "mkdir -p #{LIBEIO_OUTPUT_DIR}" if !File.directory?(LIBEIO_OUTPUT_DIR)
sh "cd #{LIBEIO_OUTPUT_DIR} && sh #{LIBEIO_SOURCE_DIR}configure " +
"--disable-shared --enable-static CFLAGS='#{cflags}'"
@@ -183,6 +183,7 @@
libeio_sources = Dir["ext/libeio/{*.c,*.h}"]
file LIBEIO_OUTPUT_DIR + ".libs/libeio.a" => [LIBEIO_OUTPUT_DIR + "Makefile"] + libeio_sources do
sh "rm -f #{LIBEIO_OUTPUT_DIR}/libeio.la"
+ sh "cd #{LIBEIO_OUTPUT_DIR} && make eio.o"
sh "cd #{LIBEIO_OUTPUT_DIR} && make libeio.la"
end
diff -Nru nginx-1.4.2.orig/passenger/ext/boost/libs/thread/src/pthread/thread.cpp nginx-1.4.2/passenger/ext/boost/libs/thread/src/pthread/thread.cpp
--- nginx-1.4.2.orig/passenger/ext/boost/libs/thread/src/pthread/thread.cpp 2013-08-05 22:44:33.000000000 +0200
+++ nginx-1.4.2/passenger/ext/boost/libs/thread/src/pthread/thread.cpp 2013-08-14 08:14:56.567500424 +0200
@@ -376,6 +376,7 @@
boost::throw_exception(thread_resource_error(system::errc::invalid_argument, "boost thread: thread not joinable"));
#endif
}
+ return false;
}
bool thread::joinable() const BOOST_NOEXCEPT
diff -Nru nginx-1.4.2.orig/passenger/lib/phusion_passenger/common_library.rb nginx-1.4.2/passenger/lib/phusion_passenger/common_library.rb
--- nginx-1.4.2.orig/passenger/lib/phusion_passenger/common_library.rb 2013-08-05 22:44:31.000000000 +0200
+++ nginx-1.4.2/passenger/lib/phusion_passenger/common_library.rb 2013-08-14 08:20:58.981516595 +0200
@@ -101,7 +101,7 @@
end
def define_tasks(extra_compiler_flags = nil)
- flags = "-Iext -Iext/common #{LIBEV_CFLAGS} #{extra_compiler_flags} "
+ flags = "-Iext -Iext/common #{LIBEV_CFLAGS} #{extra_compiler_flags} -fPIC #{ENV['RPM_OPT_FLAGS']} "
flags << "#{PlatformInfo.portability_cflags} #{EXTRA_CXXFLAGS}"
flags.strip!