Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AIX 7.2 missing vasprintf() #1908

Closed
DoktorCranium opened this issue Jun 22, 2019 · 4 comments
Closed

AIX 7.2 missing vasprintf() #1908

DoktorCranium opened this issue Jun 22, 2019 · 4 comments
Milestone

Comments

@DoktorCranium
Copy link

DoktorCranium commented Jun 22, 2019

Compilation finishes on AIX 7.2 via Ruby gems (both 2.5.0 and 2.6.0) and GCC 8.1.0
Execution of the compiled gem however fails on AIX 7.2

bash-5.0# /usr/local/bin/gem install nokogiri-1.10.3.gem 
Building native extensions. This could take a while...
Successfully installed nokogiri-1.10.3
Parsing documentation for nokogiri-1.10.3
Done installing documentation for nokogiri after 49 seconds
1 gem installed
bash-5.0# /usr/local/bin/nokogiri 
Traceback (most recent call last):
        8: from /usr/local/bin/nokogiri:23:in `<main>'
        7: from /usr/local/bin/nokogiri:23:in `load'
        6: from /usr/local/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.3/bin/nokogiri:6:in `<top (required)>'
        5: from /usr/local/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
        4: from /usr/local/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
        3: from /usr/local/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.3/lib/nokogiri.rb:28:in `<top (required)>'
        2: from /usr/local/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.3/lib/nokogiri.rb:32:in `rescue in <top (required)>'
        1: from /usr/local/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
/usr/local/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': load failed - /usr/local/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.3/lib/nokogiri/nokogir.so. Please issue below command for detailed reasons: (LoadError)
        /usr/sbin/execerror ruby "(ld 3 1 vasprintf /usr/local/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.3/lib/nokogiri/nokogiri.so" 
bash-5.0# /usr/sbin/execerror ruby "(ld 3 1 vasprintf /usr/local/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.3/lib/nokogiri/nokogiri.so"
exec(): 0509-036 Cannot load program ruby because of the following errors:
rtld: 0712-001 Symbol vasprintf was referenced
      from module /usr/local/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.3/lib/nokogiri/nokogiri.so(), but a runtime definition
      of the symbol was not found.
bash-5.0# dump -H /usr/local/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.3/lib/nokogiri/nokogiri.so

/usr/local/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.3/lib/nokogiri/nokogiri.so:

                        ***Loader Section***
                      Loader Header Information
VERSION#         #SYMtableENT     #RELOCent        LENidSTR
0x00000001       0x000000d0       0x00002a3b       0x00000234       

#IMPfilID        OFFidSTR         LENstrTBL        OFFstrTBL
0x00000009       0x00020e64       0x0000095c       0x00021098       


                        ***Import File Strings***
INDEX  PATH                          BASE                MEMBER              
0      .:/usr/local/lib:/usr/local/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.3/ports/powerpc-ibm-aix7.2.3.0/libxml2/2.9.9/lib:/usr/local/lib/ruby/gems/2.5.0/gems/nokogii-1.10.3/ports/powerpc-ibm-aix7.2.3.0/libxslt/1.1.33/lib:/opt/freeware/lib:/usr/freeware/bin/../lib/gcc/powerpc-ibm-aix7.2.0.0/8.1.0:/usr/freeware/bin/../lib/gcc:/us/freeware/bin/../lib/gcc/powerpc-ibm-aix7.2.0.0/8.1.0/../../..:/usr/lib:/lib                                         
1                                    libiconv.a          libiconv.so.2       
2                                    libpthread.a        shr_comm.o          
3                                    libpthread.a        shr_xpg5.o          
4                                    liblzma.a           liblzma.so.5        
5                                    libz.a              libz.so.1           
6                                    libgmp.a            libgmp.so.10        
7                                    libc.a              shr.o               
8                                    ..      

@DoktorCranium DoktorCranium changed the title AIX 7.2 missing vasprintf() missing AIX 7.2 missing vasprintf() Jun 22, 2019
@DoktorCranium
Copy link
Author

DoktorCranium commented Jun 22, 2019

Following fixes the build on AIX
change nokogiri-1.10.3/ext/nokogir/extconf.rb

if nix?
  $CFLAGS << " -DXP_WIN -DXP_WIN32 -DUSE_INCLUDED_VASPRINTF "

and rebuild

bash-5.0# nokogiri --version                                                                 
# Nokogiri (1.10.3)
    ---
    warnings: []
    nokogiri: 1.10.3
    ruby:
      version: 2.5.1
      platform: powerpc-aix7.2.0
      description: ruby 2.5.1p57 (2018-03-29 revision 63029) [powerpc-aix7.2.0]
      engine: ruby
    libxml:
      binding: extension
      source: packaged
      libxml2_path: "/usr/local/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.3/ports/powerpc-ibm-aix7.2.3.0/libxml2/2.9.9"
      libxslt_path: "/usr/local/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.3/ports/powerpc-ibm-aix7.2.3.0/libxslt/1.1.33"
      libxml2_patches:
      - 0001-Revert-Do-not-URI-escape-in-server-side-includes.patch
      - 0002-Remove-script-macro-support.patch
      - 0003-Update-entities-to-remove-handling-of-ssi.patch
      libxslt_patches:
      - 0001-Fix-security-framework-bypass.patch
      compiled: 2.9.9
      loaded: 2.9.9

@flavorjones
Copy link
Member

Thanks for submitting this issue and a proposed solution.

The problem appears very similar to what we see on Solaris, which is solved with this code in extconf.rb:

def solaris?
  RbConfig::CONFIG['target_os'] =~ /solaris/
end

...

if solaris?
  $CFLAGS << " -DUSE_INCLUDED_VASPRINTF"
end

Can you please tell me what the value of RbConfig::CONFIG['target_os'] is on your platform? I don't have access to an AIX system.

@DoktorCranium
Copy link
Author

bash-5.0# cat test.rb
#!/usr/bin/env ruby
require 'rbconfig'
require 'yaml'
puts RbConfig::CONFIG
bash-5.0# ruby test.rb
{"DESTDIR"=>"", "MAJOR"=>"2", "MINOR"=>"5", "TEENY"=>"1", "PATCHLEVEL"=>"57", "INSTALL"=>"/usr/bin/install -c", "EXEEXT"=>"", "prefix"=>"/usr/local", "ruby_install_name"=>"ruby", "RUBY_INSTALL_NAME"=>"ruby", "RUBY_SO_NAME"=>"ruby", "exec"=>"exec", "ruby_pc"=>"ruby-2.5.pc", "PACKAGE"=>"ruby", "BUILTIN_TRANSSRCS"=>" enc/trans/newline.c", "USE_RUBYGEMS"=>"YES", "MANTYPE"=>"man", "vendorarchhdrdir"=>"/usr/local/include/ruby-2.5.0/vendor_ruby/powerpc-aix7.2.0", "sitearchhdrdir"=>"/usr/local/include/ruby-2.5.0/site_ruby/powerpc-aix7.2.0", "rubyarchhdrdir"=>"/usr/local/include/ruby-2.5.0/powerpc-aix7.2.0", "vendorhdrdir"=>"/usr/local/include/ruby-2.5.0/vendor_ruby", "sitehdrdir"=>"/usr/local/include/ruby-2.5.0/site_ruby", "rubyhdrdir"=>"/usr/local/include/ruby-2.5.0", "RUBY_SEARCH_PATH"=>"", "UNIVERSAL_INTS"=>"", "UNIVERSAL_ARCHNAMES"=>"", "configure_args"=>" '--disable-install-doc' '--disable-install-rdoc'", "CONFIGURE"=>"configure", "vendorarchdir"=>"/usr/local/lib/ruby/vendor_ruby/2.5.0/powerpc-aix7.2.0", "vendorlibdir"=>"/usr/local/lib/ruby/vendor_ruby/2.5.0", "vendordir"=>"/usr/local/lib/ruby/vendor_ruby", "sitearchdir"=>"/usr/local/lib/ruby/site_ruby/2.5.0/powerpc-aix7.2.0", "sitelibdir"=>"/usr/local/lib/ruby/site_ruby/2.5.0", "sitedir"=>"/usr/local/lib/ruby/site_ruby", "rubyarchdir"=>"/usr/local/lib/ruby/2.5.0/powerpc-aix7.2.0", "rubylibdir"=>"/usr/local/lib/ruby/2.5.0", "ruby_version"=>"2.5.0", "sitearch"=>"powerpc-aix7.2.0", "arch"=>"powerpc-aix7.2.0", "sitearchincludedir"=>"/usr/local/include/powerpc-aix7.2.0", "archincludedir"=>"/usr/local/include/powerpc-aix7.2.0", "sitearchlibdir"=>"/usr/local/lib/powerpc-aix7.2.0", "archlibdir"=>"/usr/local/lib/powerpc-aix7.2.0", "libdirname"=>"libdir", "RUBY_EXEC_PREFIX"=>"/usr/local", "RUBY_LIB_VERSION"=>"", "RUBY_LIB_VERSION_STYLE"=>"3\t/* full */", "RI_BASE_NAME"=>"ri", "ridir"=>"/usr/local/share/ri", "rubysitearchprefix"=>"/usr/local/lib/ruby/powerpc-aix7.2.0", "rubyarchprefix"=>"/usr/local/lib/ruby/powerpc-aix7.2.0", "MAKEFILES"=>"Makefile", "PLATFORM_DIR"=>"", "THREAD_MODEL"=>"pthread", "SYMBOL_PREFIX"=>"", "EXPORT_PREFIX"=>"", "COMMON_HEADERS"=>"", "COMMON_MACROS"=>"", "COMMON_LIBS"=>"", "MAINLIBS"=>"", "ENABLE_SHARED"=>"no", "DLDLIBS"=>" -lc", "SOLIBS"=>"", "LIBRUBYARG_SHARED"=>"", "LIBRUBYARG_STATIC"=>"-lruby-static", "LIBRUBYARG"=>"-lruby-static", "LIBRUBY"=>"libruby-static.a", "LIBRUBY_ALIASES"=>"libruby.so", "LIBRUBY_SONAME"=>"libruby.so.2.5", "LIBRUBY_SO"=>"libruby.so.2.5.1", "LIBRUBY_A"=>"libruby-static.a", "RUBYW_INSTALL_NAME"=>"", "rubyw_install_name"=>"", "EXTDLDFLAGS"=>"-e$(TARGET_ENTRY)", "EXTLDFLAGS"=>"", "strict_warnflags"=>"-std=gnu99", "warnflags"=>"-Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wmisleading-indentation -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wimplicit-fallthrough=0 -Wduplicated-cond -Wrestrict", "debugflags"=>"-ggdb3", "optflags"=>"-O3", "NULLCMD"=>":", "ENABLE_DEBUG_ENV"=>"", "DLNOBJ"=>"dln.o", "INSTALL_STATIC_LIBRARY"=>"yes", "EXECUTABLE_EXTS"=>"", "ARCHFILE"=>"ruby.imp", "LIBRUBY_RELATIVE"=>"no", "EXTOUT"=>".ext", "PREP"=>"miniruby", "CROSS_COMPILING"=>"no", "TEST_RUNNABLE"=>"yes", "rubylibprefix"=>"/usr/local/lib/ruby", "setup"=>"Setup", "ENCSTATIC"=>"", "EXTSTATIC"=>"", "STRIP"=>"strip", "SOEXT"=>"so", "TRY_LINK"=>"gcc -L. -oconftest $(INCFLAGS) -I$(hdrdir) -D_LARGE_FILES=1 -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wmisleading-indentation -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wimplicit-fallthrough=0 -Wduplicated-cond -Wrestrict $(src) $(LIBPATH) $(LOCAL_LIBS) -lpthread -lgmp -ldl -lcrypt -lm ", "PRELOADENV"=>"LD_PRELOAD", "LIBPATHENV"=>"LIBPATH", "RPATHFLAG"=>"", "LIBPATHFLAG"=>" -L%s", "LINK_SO"=>"", "ASMEXT"=>"S", "LIBEXT"=>"a", "DLEXT2"=>"", "DLEXT"=>"so", "LDSHAREDXX"=>"g++ -Wl,-G", "LDSHARED"=>"gcc -Wl,-G", "CCDLFLAGS"=>"", "STATIC"=>"", "ARCH_FLAG"=>"", "DLDFLAGS"=>"", "ALLOCA"=>"", "dsymutil"=>"", "codesign"=>"", "POSTLINK"=>":", "WERRORFLAG"=>"-Werror", "CHDIR"=>"cd -P", "RMALL"=>"rm -fr", "RMDIRS"=>"rmdir -p", "RMDIR"=>"rmdir", "CP"=>"cp", "RM"=>"rm -f", "PKG_CONFIG"=>"pkg-config", "DOXYGEN"=>"", "DOT"=>"", "MAKEDIRS"=>"mkdir -p", "MKDIR_P"=>"mkdir -p", "INSTALL_DATA"=>"/usr/bin/install -c -m 644", "INSTALL_SCRIPT"=>"/usr/bin/install -c", "INSTALL_PROGRAM"=>"/usr/bin/install -c", "SET_MAKE"=>"", "LN_S"=>"ln -s", "NM"=>"nm", "DLLWRAP"=>"", "WINDRES"=>"", "OBJCOPY"=>":", "OBJDUMP"=>"", "ASFLAGS"=>"", "AS"=>"as", "ARFLAGS"=>"rcu ", "AR"=>"ar", "RANLIB"=>"ranlib", "try_header"=>"", "CC_VERSION_MESSAGE"=>"gcc (GCC) 8.1.0\nCopyright (C) 2018 Free Software Foundation, Inc.\nThis is free software; see the source for copying conditions. There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.", "CC_VERSION"=>"gcc --version", "CSRCFLAG"=>"", "COUTFLAG"=>"-o ", "OUTFLAG"=>"-o ", "CPPOUTFILE"=>"-o conftest.i", "GNU_LD"=>"no", "LD"=>"ld", "GCC"=>"yes", "EGREP"=>"/usr/bin/grep -E", "GREP"=>"/usr/bin/grep", "CPP"=>"gcc -E", "CXXFLAGS"=>"-O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wmisleading-indentation -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wimplicit-fallthrough=0 -Wduplicated-cond -Wrestrict", "CXX"=>"g++", "OBJEXT"=>"o", "CPPFLAGS"=>" -D_LARGE_FILES=1 ", "LDFLAGS"=>"-L. ", "CFLAGS"=>"-O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wmisleading-indentation -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wimplicit-fallthrough=0 -Wduplicated-cond -Wrestrict", "CC"=>"gcc", "target_os"=>"aix7.2.0", "target_vendor"=>"ibm", "target_cpu"=>"powerpc", "target"=>"powerpc-ibm-aix7.2.0", "host_os"=>"aix7.2.3.0", "host_vendor"=>"ibm", "host_cpu"=>"powerpc", "host"=>"powerpc-ibm-aix7.2.3.0", "RUBY_VERSION_NAME"=>"ruby-2.5.0", "RUBYW_BASE_NAME"=>"rubyw", "RUBY_BASE_NAME"=>"ruby", "build_os"=>"aix7.2.3.0", "build_vendor"=>"ibm", "build_cpu"=>"powerpc", "build"=>"powerpc-ibm-aix7.2.3.0", "RUBY_API_VERSION"=>"2.5", "RUBY_PROGRAM_VERSION"=>"2.5.1", "HAVE_GIT"=>"yes", "GIT"=>"git", "cxxflags"=>"-O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wmisleading-indentation -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wimplicit-fallthrough=0 -Wduplicated-cond -Wrestrict", "cppflags"=>"", "cflags"=>"-O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wmisleading-indentation -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wimplicit-fallthrough=0 -Wduplicated-cond -Wrestrict", "target_alias"=>"", "host_alias"=>"", "build_alias"=>"", "LIBS"=>"-lpthread -lgmp -ldl -lcrypt -lm ", "ECHO_T"=>"", "ECHO_N"=>"", "ECHO_C"=>"\\c", "DEFS"=>"-D_LARGE_FILES=1", "mandir"=>"/usr/local/share/man", "localedir"=>"/usr/local/share/locale", "libdir"=>"/usr/local/lib", "psdir"=>"/usr/local/share/doc/ruby", "pdfdir"=>"/usr/local/share/doc/ruby", "dvidir"=>"/usr/local/share/doc/ruby", "htmldir"=>"/usr/local/share/doc/ruby", "infodir"=>"/usr/local/share/info", "docdir"=>"/usr/local/share/doc/ruby", "oldincludedir"=>"/usr/include", "includedir"=>"/usr/local/include", "localstatedir"=>"/usr/local/var", "sharedstatedir"=>"/usr/local/com", "sysconfdir"=>"/usr/local/etc", "datadir"=>"/usr/local/share", "datarootdir"=>"/usr/local/share", "libexecdir"=>"/usr/local/libexec", "sbindir"=>"/usr/local/sbin", "bindir"=>"/usr/local/bin", "exec_prefix"=>"/usr/local", "PACKAGE_URL"=>"", "PACKAGE_BUGREPORT"=>"", "PACKAGE_STRING"=>"", "PACKAGE_VERSION"=>"", "PACKAGE_TARNAME"=>"", "PACKAGE_NAME"=>"", "PATH_SEPARATOR"=>":", "SHELL"=>"/bin/sh", "UNICODE_VERSION"=>"10.0.0", "archdir"=>"/usr/local/lib/ruby/2.5.0/powerpc-aix7.2.0", "topdir"=>"/usr/local/lib/ruby/2.5.0/powerpc-aix7.2.0"}
bash-5.0#

@flavorjones
Copy link
Member

This should be fixed in v1.11.0.rc2 when it comes out.

@flavorjones flavorjones added this to the v1.11.0 milestone Feb 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants