passenger-4.0.48 Compilation Error

32 views
Skip to first unread message

Tech Up

unread,
Aug 3, 2014, 8:15:30 AM8/3/14
to phusion-...@googlegroups.com
Hello,

On running ./bin/passenger-install-apache2-module, after the compilation starts, I get the following error:

....

In file included from ext/common/MessageServer.h:51:0,
                 from ext/common/Utils.cpp:54:
ext/common/Utils/MessageIO.h:121:20: error: reference to 'uint16_t' is ambiguous
/usr/include/stdint.h:49:28: error: candidates are: typedef short unsigned int uint16_t
ext/boost/cstdint.hpp:234:30: error:                 typedef short unsigned int boost::uint16_t
ext/common/Utils/MessageIO.h:121:20: error: 'uint16_t' has not been declared
ext/common/Utils/MessageIO.h: In function 'bool Passenger::readUint16(int, int&, long long unsigned int*)':
ext/common/Utils/MessageIO.h:122:2: error: reference to 'uint16_t' is ambiguous
/usr/include/stdint.h:49:28: error: candidates are: typedef short unsigned int uint16_t
ext/boost/cstdint.hpp:234:30: error:                 typedef short unsigned int boost::uint16_t
ext/common/Utils/MessageIO.h:122:11: error: expected ';' before 'temp'
ext/common/Utils/MessageIO.h:124:21: error: 'temp' was not declared in this scope
ext/common/Utils/MessageIO.h:124:34: error: reference to 'uint16_t' is ambiguous
/usr/include/stdint.h:49:28: error: candidates are: typedef short unsigned int uint16_t

.....

Anybody else facing the same issue?

My platform is Gentoo Linux.

Please let me know if you need additional details.

Thanks and Regards,

TU

Hongli Lai

unread,
Aug 11, 2014, 5:34:27 AM8/11/14
to phusion-passenger
This is a bug in our source code that needs to be fixed. I've filed a
bug here: https://github.com/phusion/passenger/issues/1261
> --
> You received this message because you are subscribed to the Google Groups
> "Phusion Passenger Discussions" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to phusion-passen...@googlegroups.com.
> To post to this group, send email to phusion-...@googlegroups.com.
> Visit this group at http://groups.google.com/group/phusion-passenger.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/phusion-passenger/e9b8437e-7005-4eb2-8fb1-0b6b3bf2ca38%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Phusion | Web Application deployment, scaling, and monitoring solutions

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl
Chamber of commerce no: 08173483 (The Netherlands)

Tony Li

unread,
Aug 12, 2014, 11:32:35 PM8/12/14
to phusion-...@googlegroups.com, hon...@phusion.nl
Hi Hongli,

 Thanks for looking into this, however, the fix doesn't work to me. I was using passenger-install-apache2-module to install passenger, and saw those error, and checking source code, I changed something in 2 places, see below, basically it's removing wrong checking for cxx compiler in compiler.rb and adding apache2_module_cxxflags in apache.rb, then let compiler use apache2_module_cxxflags in apache2.rb.

root@dtcd-absnda1 # diff ./lib/phusion_passenger/platform_info/compiler.rb.bak ./lib/phusion_passenger/platform_info/compiler.rb
206c206
<               `#{cxx} -V 2>&1` =~ /Sun C/ || `#{cc} -flags 2>&1` =~ /Sun C/
---
>               `#{cxx} -V 2>&1` =~ /Sun C/

##add a apache2_module_cxxflags part into apache.rb, to allow c++ use -fPIC, as in our solaris, cc is for Sun sparc, but c++ is gcc
root@dtcd-absnda1 # diff ./lib/phusion_passenger/platform_info/apache.rb.bak ./lib/phusion_passenger/platform_info/apache.rb
601a602,690
>
>  ################ CXX Compiler and linker flags ################
>
>         # The C compiler flags that are necessary to compile an Apache module.
>         # Also includes APR and APU compiler flags if with_apr_flags is true.
>         def self.apache2_module_cxxflags(with_apr_flags = true)
>                 flags = [""]
>                 if cxx_is_sun_studio?
>                         flags << "-fPIC"
>                 else
>                         flags << "-fPIC"
>                 end
>                 if with_apr_flags
>                         flags << apr_flags
>                         flags << apu_flags
>                 end
>                 if !apxs2.nil?
>                         apxs2_flags = `#{apxs2} -q CFLAGS`.strip << " -I" << `#{apxs2} -q INCLUDEDIR`.strip
>                         apxs2_flags.gsub!(/-O\d? /, '')
>
>                         # Remove flags not supported by GCC
>                         if os_name =~ /solaris/ # TODO: Add support for people using SunStudio
>                                 # The big problem is Coolstack apxs includes a bunch of solaris -x directives.
>                                 options = apxs2_flags.split
>                                 options.reject! { |f| f =~ /^\-x/ }
>                                 options.reject! { |f| f =~ /^\-Xa/ }
>                                 options.reject! { |f| f =~ /^\-fast/ }
>                                 options.reject! { |f| f =~ /^\-mt/ }
>                                 apxs2_flags = options.join(' ')
>                         end
>
>                         if os_name == "linux" &&
>                            linux_distro_tags.include?(:redhat) &&
>                            apxs2 == "/usr/sbin/apxs" &&
>                            httpd_architecture_bits == 64
>                                 # The Apache package in CentOS 5 x86_64 is broken.
>                                 # 'apxs -q CFLAGS' contains directives for compiling
>                                 # the module as 32-bit, even though httpd itself
>                                 # is 64-bit. Fix this.
>                                 apxs2_flags.gsub!('-m32 -march=i386 -mtune=generic', '')
>                         end
>
>                         apxs2_flags.strip!
>                         flags << apxs2_flags
>                 end
>                 if !httpd.nil? && os_name == "macosx"
>                         # The default Apache install on OS X is a universal binary.
>                         # Figure out which architectures it's compiled for and do the same
>                         # thing for mod_passenger. We use the 'file' utility to do this.
>                         #
>                         # Running 'file' on the Apache executable usually outputs something
>                         # like this:
>                         #
>                         #   /usr/sbin/httpd: Mach-O universal binary with 4 architectures
>                         #   /usr/sbin/httpd (for architecture ppc7400):     Mach-O executable ppc
>                         #   /usr/sbin/httpd (for architecture ppc64):       Mach-O 64-bit executable ppc64
>                         #   /usr/sbin/httpd (for architecture i386):        Mach-O executable i386
>                         #   /usr/sbin/httpd (for architecture x86_64):      Mach-O 64-bit executable x86_64
>                         #
>                         # But on some machines, it may output just:
>                         #
>                         #   /usr/sbin/httpd: Mach-O fat file with 4 architectures
>                         #
>                         # (http://code.google.com/p/phusion-passenger/issues/detail?id=236)
>                         output = `file "#{httpd}"`.strip
>                         if output =~ /Mach-O fat file/ && output !~ /for architecture/
>                                 architectures = ["i386", "ppc", "x86_64", "ppc64"]
>                         else
>                                 architectures = []
>                                 output.split("\n").grep(/for architecture/).each do |line|
>                                         line =~ /for architecture (.*?)\)/
>                                         architectures << $1
>                                 end
>                         end
>                         # The compiler may not support all architectures in the binary.
>                         # XCode 4 seems to have removed support for the PPC architecture
>                         # even though there are still plenty of Apache binaries around
>                         # containing PPC components.
>                         architectures.reject! do |arch|
>                                 !compiler_supports_architecture?(arch)
>                         end
>                         architectures.map! do |arch|
>                                 "-arch #{arch}"
>                         end
>                         flags << architectures.compact.join(' ')
>                 end
>                 return flags.compact.join(' ').strip
>         end
>         memoize :apache2_module_cxxflags, true
603c692,693
<       # Linker flags that are necessary for linking an Apache module.
---
>
> # Linker flags that are necessary for linking an Apache module.
             flags << "-fPIC"

##To allow complier actually use the apache2_module_cxxflags.
root@dtcd-absnda1 # diff ./build/apache2.rb.bak ./build/apache2.rb
66c66
<       "-Iext -Iext/common #{PlatformInfo.apache2_module_cflags} " <<
---
>       "-Iext -Iext/common #{PlatformInfo.apache2_module_cxxflags} " <<
71c71
<       PlatformInfo.apache2_module_cflags)
---
>       PlatformInfo.apache2_module_cxxflags)
77c77
<       define_tasks(PlatformInfo.apache2_module_cflags).
---
>       define_tasks(PlatformInfo.apache2_module_cxxflags).

I also did other changes which I have done in previous 4.0.46 installation, see here: https://groups.google.com/forum/#!topic/phusion-passenger/hCKf017pM9E

Hongli Lai

unread,
Aug 13, 2014, 6:40:27 AM8/13/14
to phusion-passenger
Reply all
Reply to author
Forward
0 new messages