ADLINK-IST / opensplice

This is the Vortex OpenSplice Community Edition source repository. For our commercial offering see
https://www.adlinktech.com/en/vortex-opensplice-data-distribution-service
Apache License 2.0
259 stars 157 forks source link

Compilation fails with gcc/g++ 4.9 #18

Closed j-rivero closed 7 years ago

j-rivero commented 9 years ago

Trying to compile the openslice current master branch using a gcc 4.9 (default compiler in Ubuntu Vivid) ends up failing with the following message:

g++    -static-libgcc -L/tmp/buildd/libopensplice64-6.4.0/lib/x86_64.linux-release -D_GNU_SOURCE -DOSPL_LINUX -O4 -fno-strict-aliasing -flto -DNDEBUG -Wall -W -pedantic -Wno-long-long -Wno-variadic-macros -Werror=uninitialized -DDO_HOST_BY_NAME -L. ast_boxed_value.o xbe_utils.o ast_attribute.o xbe_interface.o xbe_structure.o xbe_argument.o xbe_enum.o xbe_source.o xbe_produce.o std.o utl_pragmas.o ast_union_label.o xbe_constant.o xbe_attribute.o ast_typedef.o xbe_init.o fe_init.o fe_declarator.o ast_concrete_type.o utl_indenter.o ast_type.o drv_init.o xbe_predefined.o ast_exception.o ast_generator.o fe_private.o xbe_args.o xbe_typedef.o ast_constant.o utl_decllist.o utl_labellist.o xbe_argument2.o xbe_incl.o utl_identifier.o xbe_root.o drv_args.o xbe_type.o utl_wstring.o utl_string.o xbe_exception.o ast_enum_val.o ast_decl.o drv_param.o xbe_globals.o fe_value_header.o utl_idlist.o ast_statemember.o xbe_cppscope.o ast_union_branch.o ast_initializer.o utl_strlist.o xbe_interface2.o utl_stack.o xbe_cppname.o xbe_cpptype.o nr_narrow.o y_tab.o xbe_cppfwd.o ast_check.o xbe_classes.o ast_root.o ast_interface_fwd.o ast_expression.o utl_scope.o xbe_direction.o utl_list.o utl_error.o xbe_string.o utl_namelist.o xbe_module.o lex_yy.o xbe_genlist.o fe_interface_header.o ast_redef.o ast_operation.o fe_extern.o ast_string.o xbe_arglist.o ast_hdrs.o utl_exceptlist.o ast_module.o ast_array.o ast_interface.o ast_value_fwd.o ast_predefined_type.o xbe_dispatchable.o drv_fork.o fe_value_inheritance_spec.o ast_union.o xbe_operation.o utl_global.o utl_exprlist.o drv_link.o xbe_union.o xbe_array.o drv_preproc.o xps_vector.o ast_opaque.o xbe_literals.o ast_sequence.o ast_value.o xbe_classgen.o cppgen.o xbe_invoke.o xbe_generator.o xbe_hash.o xps_string.o xbe_interface3.o xbe_dispatcher.o xbe_value.o drv_private.o drv_main.o xbe_codegen.o xbe_expr_val.o xbe_opnameset.o ast_recursive.o xbe_field.o ast_structure.o xbe_time.o ast_argument.o ast_enum.o ast_field.o xbe_sequence.o libstdc++.a -lc -lm -ldl -lpthread -lrt -lddscpp -lddshts  -o cppgen
/tmp/ccRAmaNd.ltrans7.ltrans.o: In function `idl_parse_line_and_file(char*)':
<artificial>:(.text+0x1199): undefined reference to `fstackdepth'
/tmp/ccRAmaNd.ltrans7.ltrans.o: In function `yy_get_next_buffer()':
<artificial>:(.text+0x1a19): undefined reference to `preprocess_getc'
/tmp/ccRAmaNd.ltrans14.ltrans.o: In function `main':
<artificial>:(.text.startup+0x320): undefined reference to `init_preprocess'
/tmp/ccRAmaNd.ltrans18.ltrans.o: In function `DRV_drive':
<artificial>:(.text+0x303c): undefined reference to `preprocess'
<artificial>:(.text+0x3517): undefined reference to `preprocess_getc'
/tmp/ccRAmaNd.ltrans24.ltrans.o: In function `DRV_cpp_putarg':
<artificial>:(.text+0x3eeb): undefined reference to `define'
<artificial>:(.text+0x3f0c): undefined reference to `define'
<artificial>:(.text+0x3f78): undefined reference to `define'
<artificial>:(.text+0x3fcb): undefined reference to `Ifile'
<artificial>:(.text+0x4015): undefined reference to `undef'
collect2: error: ld returned 1 exit status
/tmp/buildd/libopensplice64-6.4.0/setup/makefiles/target-only.mak:92: recipe for target 'cppgen' failed

The same code can be compiled successfully with gcc 4.8. There is probably some object code missing in that compiler command that did not trigger a failure in 4.8 linker (probably it does not try to resolve references at linking time) but after some changes in linker in gcc version 4.9 now they need to be resolved at linking time.

j-oberlaender commented 9 years ago

Just had the same problem and ran into https://bugs.archlinux.org/task/43367 - the last comment on that page seemed to help. On my system I used:

sudo ln -s /usr/lib/gcc/x86_64-linux-gnu/4.9.2/liblto_plugin.so /usr/lib/bfd-plugins/

Adjust accordingly for your gcc version and machine. After that, a make clean; make worked just fine. Essentially it's a minor bug in binutils-2.25. Oh, and you might have to create that directory first:

sudo mkdir -p /usr/lib/bfd-plugins
pczzy commented 9 years ago

Nice ,it's helpful to me . thanks a million

jacquelinekay commented 8 years ago

I encounter the same issue on Ubuntu 16.04 Xenial with gcc 5.3.1, but the workaround to symlink liblto_plugin.so into bfd-plugins does not work. Any tips?

nxdefiant commented 8 years ago

Confirmed with Debian, but really needs to make clean.

b3em commented 7 years ago

Same as #33, it's fixed