TritonDataCenter / smartos-live

For more information, please see http://smartos.org/ For any questions that aren't answered there, please join the SmartOS discussion list: https://smartos.topicbox.com/groups/smartos-discuss
1.57k stars 245 forks source link

Build failed #896

Closed MrOffline77 closed 4 years ago

MrOffline77 commented 4 years ago

Hi, our build fails with master and the two 2020 release branches. I have no clue what it could be. Can you help me ?

./../../../gcc-gcc-7.4.0-il-1-32strap/./libstdc++-v3/libsupc++/new_opa.cc:47:9: error: '::aligned_alloc' has not been declared
 using ::aligned_alloc;
         ^~~~~~~~~~~~~
../../../../gcc-gcc-7.4.0-il-1-32strap/./libstdc++-v3/libsupc++/new_opa.cc: In function 'void* operator new(std::size_t, std::align_val_t)':
../../../../gcc-gcc-7.4.0-il-1-32strap/./libstdc++-v3/libsupc++/new_opa.cc:128:20: error: '__gnu_cxx::aligned_alloc' has not been declared
   using __gnu_cxx::aligned_alloc;
                    ^~~~~~~~~~~~~
../../../../gcc-gcc-7.4.0-il-1-32strap/./libstdc++-v3/libsupc++/new_opa.cc:129:33: error: 'aligned_alloc' was not declared in this scope
   while (__builtin_expect ((p = aligned_alloc (align, sz)) == 0, false))
                                 ^~~~~~~~~~~~~
../../../../gcc-gcc-7.4.0-il-1-32strap/./libstdc++-v3/libsupc++/new_opa.cc:129:33: note: suggested alternative:
In file included from /usr/include/stdlib.h:39:0,
                 from /root/smartosbuild/building-now/smartos-live/projects/illumos-extra/gcc7/gcc-gcc-7.4.0-il-1-32strap.build/i386-pc-solaris2.11/libstdc++-v3/include/cstdlib:75,
                 from /root/smartosbuild/building-now/smartos-live/projects/illumos-extra/gcc7/gcc-gcc-7.4.0-il-1-32strap.build/i386-pc-solaris2.11/libstdc++-v3/include/stdlib.h:36,
                 from ../../../../gcc-gcc-7.4.0-il-1-32strap/./libstdc++-v3/libsupc++/new_opa.cc:27:
/usr/include/iso/stdlib_c11.h:60:14: note:   'std::aligned_alloc'
 extern void *aligned_alloc(size_t, size_t);
              ^~~~~~~~~~~~~
Makefile:936: recipe for target 'new_opa.lo' failed
gmake[5]: *** [new_opa.lo] Error 1
gmake[5]: *** Waiting for unfinished jobs....
In file included from ../../../../gcc-gcc-7.4.0-il-1-32strap/./libstdc++-v3/libsupc++/del_opa.cc:38:0:
/root/smartosbuild/building-now/smartos-live/projects/illumos-extra/gcc7/gcc-gcc-7.4.0-il-1-32strap.build/i386-pc-solaris2.11/libstdc++-v3/include/cstdlib:132:11: error: '::aligned_alloc' has not been declared
   using ::aligned_alloc;
           ^~~~~~~~~~~~~
Makefile:944: recipe for target 'del_opa.lo' failed
gmake[5]: *** [del_opa.lo] Error 1
gmake[5]: Leaving directory '/root/smartosbuild/building-now/smartos-live/projects/illumos-extra/gcc7/gcc-gcc-7.4.0-il-1-32strap.build/i386-pc-solaris2.11/libstdc++-v3/libsupc++'
Makefile:510: recipe for target 'all-recursive' failed
gmake[4]: *** [all-recursive] Error 1
gmake[4]: Leaving directory '/root/smartosbuild/building-now/smartos-live/projects/illumos-extra/gcc7/gcc-gcc-7.4.0-il-1-32strap.build/i386-pc-solaris2.11/libstdc++-v3'
Makefile:417: recipe for target 'all' failed
gmake[3]: *** [all] Error 2
gmake[3]: Leaving directory '/root/smartosbuild/building-now/smartos-live/projects/illumos-extra/gcc7/gcc-gcc-7.4.0-il-1-32strap.build/i386-pc-solaris2.11/libstdc++-v3'
Makefile:17595: recipe for target 'all-stage1-target-libstdc++-v3' failed
gmake[2]: *** [all-stage1-target-libstdc++-v3] Error 2
gmake[2]: Leaving directory '/root/smartosbuild/building-now/smartos-live/projects/illumos-extra/gcc7/gcc-gcc-7.4.0-il-1-32strap.build'
Makefile:24519: recipe for target 'stage1-bubble' failed
gmake[1]: *** [stage1-bubble] Error 2
gmake[1]: Leaving directory '/root/smartosbuild/building-now/smartos-live/projects/illumos-extra/gcc7/gcc-gcc-7.4.0-il-1-32strap.build'
Makefile:24903: recipe for target 'bootstrap' failed
gmake: *** [bootstrap] Error 2
../Makefile.targ:27: recipe for target 'all_autoconf_32' failed
gmake[2]: *** [all_autoconf_32] Error 2
gmake[2]: Leaving directory '/root/smartosbuild/building-now/smartos-live/projects/illumos-extra/gcc7'
Makefile:160: recipe for target '/root/smartosbuild/building-now/smartos-live/proto.strap/usr/gcc/7/bin/gcc' failed
gmake[1]: *** [/root/smartosbuild/building-now/smartos-live/proto.strap/usr/gcc/7/bin/gcc] Error 2
gmake[1]: Leaving directory '/root/smartosbuild/building-now/smartos-live/projects/illumos-extra'
failed to build install_strap
Makefile:351: recipe for target '0-strap-stamp' failed
gmake: *** [0-strap-stamp] Error 1

Thank you very much !

jperkin commented 4 years ago

This is likely caused by building on a PI that does not have a fix for https://www.illumos.org/issues/9545 (https://github.com/illumos/illumos-gate/commit/0df48811699b83d09c552548effcb1718d6ff1d0)

jlevon commented 4 years ago

Please specify the exact build environment next time, thanks! As there is no bug in smartos-live itself here, I'm closing this.

MrOffline77 commented 4 years ago

@jlevon Hi, I've recreated a complete new build env as describe in the readme. When i try to build from master i stuck here

/root/smartos-live/proto.strap/usr/gcc/7/bin/gcc -O -m64 -std=gnu99 -nodefaultlibs -D__sun -msave-args -Wall -Wno-unknown-pragmas -Wno-psabi -DSMATCHDATADIR='"/root/smartos-live/projects/illumos/usr/src/tools/proto/root_i386-nd/opt/onbld/share/smatch"' -DGCC_BASE='"/no/such/dir"' -DMULTIARCH_TRIPLET=NULL -D_TS_ERRNO -nostdinc -Isrc/ -I/opt/local/include -I/usr/include -Wl,-M/root/smartos-live/projects/illumos/usr/src/common/mapfiles/common/map.noexstk -L/opt/local/lib -R/opt/local/lib -L/opt/local/lib/amd64 -R/opt/local/lib/amd64 smatch.o allocate.o builtin.o char.o compat-linux.o cse.o dissect.o dominate.o evaluate.o expand.o expression.o flow.o flowgraph.o inline.o ir.o lib.o linearize.o liveness.o memops.o opcode.o optimize.o parse.o pre-process.o ptrlist.o ptrmap.o scope.o show-parse.o simplify.o sort.o ssa.o sset.o stats.o storage.o symbol.o target.o tokenize.o unssa.o utils.o macro_table.o token_store.o hashtable.o avl.o smatch_about_fn_ptr_arg.o smatch_address.o smatch_annotate.o smatch_array_values.o smatch_assigned_expr.o smatch_bits.o smatch_buf_comparison.o smatch_buf_size.o smatch_capped.o smatch_common_functions.o smatch_comparison.o smatch_conditions.o smatch_constraints.o smatch_constraints_required.o smatch_container_of.o smatch_data_source.o smatch_db.o smatch_equiv.o smatch_estate.o smatch_expressions.o smatch_expression_stacks.o smatch_extra.o smatch_files.o smatch_flow.o smatch_fn_arg_link.o smatch_function_hooks.o smatch_function_info.o smatch_function_ptrs.o smatch_helper.o smatch_hooks.o smatch_ignore.o smatch_imaginary_absolute.o smatch_implied.o smatch_impossible.o smatch_integer_overflow.o smatch_kernel_user_data.o smatch_links.o smatch_math.o smatch_mem_tracker.o smatch_modification_hooks.o smatch_mtag_data.o smatch_mtag_map.o smatch_mtag.o smatch_nul_terminator.o smatch_param_cleared.o smatch_param_compare_limit.o smatch_parameter_names.o smatch_param_filter.o smatch_param_limit.o smatch_param_set.o smatch_param_to_mtag_data.o smatch_param_used.o smatch_parse_call_math.o smatch_passes_array_size.o smatch_project.o smatch_ranges.o smatch_real_absolute.o smatch_recurse.o smatch_returns.o smatch_return_to_param.o smatch_scope.o smatch_slist.o smatch_start_states.o smatch_statement_count.o smatch_states.o smatch_stored_conditions.o smatch_string_list.o smatch_strings.o smatch_strlen.o smatch_struct_assignment.o smatch_sval.o smatch_tracker.o smatch_type_links.o smatch_type.o smatch_type_val.o smatch_unknown_value.o smatch_untracked_param.o smatch_var_sym.o smatch_parsed_conditions.o check_64bit_shift.o check_access_ok_math.o check_all_func_returns.o check_allocating_enough_data.o check_allocation_funcs.o check_arm64_tagged.o check_array_condition.o check_assign_vs_compare.o check_atomic_inc_dec.o check_bit_shift.o check_bogus_irqrestore.o check_bogus_loop.o check_buffer_too_small_for_struct.o check_call_tree.o check_capable.o check_cast_assign.o check_check_deref.o check_cmn_err.o check_container_of.o check_continue_vs_break.o check_debug.o check_deref.o check_deref_check.o check_dereferences_param.o check_dev_queue_xmit.o check_dma_mapping_error.o check_dma_on_stack.o check_double_checking.o check_err_ptr.o check_err_ptr_deref.o check_expects_err_ptr.o check_free.o check_free_strict.o check_freeing_devm.o check_freeing_null.o check_frees_argument.o check_frees_param.o check_frees_param_strict.o check_get_user_overflow.o check_gfp_dma.o check_held_dev.o check_implicit_dependencies.o check_implicit_dependencies_tester.o check_impossible_mask.o check_indenting.o check_index_overflow.o check_info_leak.o check_input_free_device.o check_kernel.o check_kernel_printf.o check_kmalloc_to_bugon.o check_kmalloc_wrong_size.o check_kunmap.o check_leaks.o check_locking.o check_logical_instead_of_bitwise.o check_macro_side_effects.o check_macros.o check_memcpy_overflow.o check_memset.o check_min_t.o check_missing_break.o check_mod_timer.o check_no_effect.o check_no_if_block.o check_no_return.o check_nospec.o check_off_by_one_relative.o check_or_vs_and.o check_param_mapper.o check_passes_sizeof.o check_platform_device_put.o check_pointer_math.o check_precedence.o check_proc_create.o check_puts_argument.o check_readl_infinite_loops.o check_release_resource.o check_resource_size.o check_return.o check_return_cast.o check_return_efault.o check_return_enomem.o check_return_negative_var.o check_rosenberg.o check_select.o check_shift_to_zero.o check_signed.o check_signed_integer_overflow_check.o check_sizeof.o check_snprintf.o check_snprintf_overflow.o check_spectre.o check_spectre_second_half.o check_sprintf_overflow.o check_stack.o check_strcpy_overflow.o check_string_len.o check_struct_type.o check_syscall_arg_type.o check_template.o check_test_bit.o check_testing_index_after_use.o check_trinity_generator.o check_type.o check_uninitialized.o check_unreachable.o check_unused_ret.o check_unwind.o check_wait_for_common.o check_wine.o check_wine_WtoA.o check_wine_filehandles.o check_wrong_size_arg.o check_zero_to_err_ptr.o -o smatch -lsqlite3 -lcrypto -lm -lgcc -lc

ld: fatal: file /lib/amd64/libc.so: version 'ILLUMOS_0.26' does not exist:
        required by file /opt/SmartOS/build-cache/2018Q4/x86_64/7d3d5fd52c4f9652ad8735869512edc363e630ce/usr/gcc/7/bin/../lib/gcc/i386-pc-solaris2.11/7.4.0/../../../amd64/libssp.so.0
ld: fatal: file /lib/amd64/libc.so: version 'ILLUMOS_0.26' does not exist:
        required by file /opt/SmartOS/build-cache/2018Q4/x86_64/7d3d5fd52c4f9652ad8735869512edc363e630ce/usr/gcc/7/bin/../lib/gcc/i386-pc-solaris2.11/7.4.0/../../../amd64/libgcc_s.so.1
ld: fatal: file processing errors. No output written to smatch
collect2: error: ld returned 1 exit status
*** Error code 1
make: Fatal error: Command failed for target `smatch'
Current working directory /root/smartos-live/projects/illumos/usr/src/tools/smatch
*** Error code 1
The following command caused the error:
cd smatch; pwd; /opt/local/bin/dmake install
make: Fatal error: Command failed for target `smatch'
Current working directory /root/smartos-live/projects/illumos/usr/src/tools
*** Error code 1
The following command caused the error:
cd tools; pwd; /opt/local/bin/dmake RELEASE_BUILD= install
make: Fatal error: Command failed for target `bldtools'
Current working directory /root/smartos-live/projects/illumos/usr/src
gmake: *** [Makefile:342: 0-illumos-stamp] Error 1

Any ideas ?

jasonbking commented 4 years ago

Try building on a SmartOS version 20180816T002409 or later

MrOffline77 commented 4 years ago

@jasonbking thank you very much !!! This did the trick. Nevertheless I'm getting now stuck during gmake live Thank you very much <3

PS: The Zone is setup like in the readme and the build is executed as root user. So there should be no permission problem.

### Building platform image #########################################

  * Build Stamp: "20200128T094646Z"
  * Manifest File: "/root/smartosbuild/building-now/smartos-live/manifest.gen"
  * Output Directory: "/root/smartosbuild/building-now/smartos-live/output"
  * Input Directory[0]: "/root/smartosbuild/building-now/smartos-live/proto"
  * Input Directory[1]: "/root/smartosbuild/building-now/smartos-live/man/man"

Checking manual pages...                                                                                                                                                                    ... done
Checking timezone files...                                                                                                                                                                  ... done
Checking microcode files...                                                                                                                                                                 ... done
Creating temporary directory...                                                                                                                                                             ... 
  * Temporary Directory: "/tmp/build_live-0.89543"
(cont.) Creating temporary directory...                                                                                                                                                     ... done
Creating ramdisk file "/tmp/build_live-0.89543/root.image"                                                                                                                                  ... done
Creating UFS file system (/)                                                                                                                                                                ... done
Creating ramdisk file "/tmp/build_live-0.89543/usr.image"                                                                                                                                   ... done
Creating UFS file system (/usr)                                                                                                                                                             ... done (2s)
Copying files from proto areas to image                                                                                                                                                     ... done (3s)
Generating whatis database                                                                                                                                                                  ... done
Importing GZ SMF manifests                                                                                                                                                                  ... done (27s)
Building SMF seeds                                                                                                                                                                          ... done (10s)
Setting random "root" password                                                                                                                                                              ... 
  * Password: "Gohchet7eiwaegoo"
(cont.) Setting random "root" password                                                                                                                                                      ... done
Building "/etc/release" file                                                                                                                                                                ... 

BUILD FAILURE:
  [  2] bi_gen_etcrelease
        (file "./tools/build_live" line 414)
  [  3] main
        (file "./tools/build_live" line 943)

CLEANING UP ON FAILURE ...
... DONE

build_live: ERROR: failed to build "/etc/release" file
gmake: *** [Makefile:158: live] Error 1
jserviceorg commented 4 years ago

edit tools/build_live and change line #1 to #!/bin/bash -x

run again, maybe this helps

cheers,

Juergen

sjorge commented 4 years ago

Do you have "fs_allowed": "ufs,pcfs,tmpfs" set for the zone?

MrOffline77 commented 4 years ago

Hi, thanks for your suggestions.

@jserviceorg same result with #!/bin/bash -x @sjorge

"zonename": "b76ace93-c1e2-eabf-c299-f4e76041a1e3",
  "autoboot": true,
  "brand": "joyent",
  "limit_priv": "default,sys_time",
  "fs_allowed": "ufs,pcfs,tmpfs",
  "v": 1,
jserviceorg commented 4 years ago

result is the same for sure, but you should get debuggable output.

timfoster commented 4 years ago

What happens when you run ./tools/build_etc_release from the top of your workspace?

Example output from an old workspace I had lying around:

timf@smartos-build (master) ./tools/build_etcrelease  -v foo
                     SmartOS foo x86_64
                       Copyright 2020 Joyent, Inc.

  Built with the following components:

[
    {
        "repo": "smartos-live",
        "branch": "master",
        "commit_date": "1579275103",
        "rev": "40cbb7001154e2ba5e8e13d5e5b6c1ac718b6ace",
        "url": "git@github.com:joyent/smartos-live.git"
    },
    {
        "repo": "illumos-joyent",
        "branch": "master",
        "commit_date": "1579177173",
        "rev": "d3f83376d2ed784ca0a6ba3d8cd1fdaee338f1c4",
        "url": "https://github.com/joyent/illumos-joyent.git"
    },
    {
        "repo": "illumos-extra",
        "branch": "master",
        "commit_date": "1571766210",
        "rev": "7d3d5fd52c4f9652ad8735869512edc363e630ce",
        "url": "https://github.com/joyent/illumos-extra.git"
    },
    {
        "repo": "kvm",
        "branch": "master",
        "commit_date": "1570451135",
        "rev": "9ad0cc7792fc1f0e0fc8985ba8810362707b9b20",
        "url": "https://github.com/joyent/illumos-kvm.git"
    },
    {
        "repo": "kvm-cmd",
        "branch": "master",
        "commit_date": "1566942834",
        "rev": "41e7c3e192eb39bb5ced7667fdc12ad2b33e646d",
        "url": "https://github.com/joyent/illumos-kvm-cmd.git"
    },
    {
        "repo": "mdata-client",
        "branch": "master",
        "commit_date": "1482175115",
        "rev": "dbb3fdec26373f8e86c9ea0057ebba48581ff476",
        "url": "https://github.com/joyent/mdata-client.git"
    },
    {
        "repo": "ur-agent",
        "branch": "master",
        "commit_date": "1571591123",
        "rev": "6eee05e13ff33d2e1913d7ce9c9ff4b89bbd0122",
        "url": "https://github.com/joyent/sdc-ur-agent.git"
    }
]
timf@smartos-build (master)
MrOffline77 commented 4 years ago

@jserviceorg yes of course :D, but there is nothing you wouldn't expect there. No error showing up etc.

@timfoster ( last time cloned yesterday )

                     SmartOS foo x86_64
                       Copyright 2020 Joyent, Inc.

  Built with the following components:

[
    {
        "repo": "smartos-live",
        "branch": "master",
        "commit_date": "1580131179",
        "rev": "aaa890e038179e0710b6ce3420bb5ccbe3858e96",
        "url": "https://github.com/joyent/smartos-live.git"
    },
    {
        "repo": "illumos-joyent",
        "branch": "master",
        "commit_date": "1580211558",
        "rev": "ee930d2f04dcbdb046103cf48945c9e0643f47d7",
        "url": "https://github.com/joyent/illumos-joyent.git"
    },
    {
        "repo": "illumos-extra",
        "branch": "master",
        "commit_date": "1571766210",
        "rev": "7d3d5fd52c4f9652ad8735869512edc363e630ce",
        "url": "https://github.com/joyent/illumos-extra.git"
    },
    {
        "repo": "kvm",
        "branch": "master",
        "commit_date": "1570451135",
        "rev": "9ad0cc7792fc1f0e0fc8985ba8810362707b9b20",
        "url": "https://github.com/joyent/illumos-kvm.git"
    },
    {
        "repo": "kvm-cmd",
        "branch": "master",
        "commit_date": "1566942834",
        "rev": "41e7c3e192eb39bb5ced7667fdc12ad2b33e646d",
        "url": "https://github.com/joyent/illumos-kvm-cmd.git"
    },
    {
        "repo": "mdata-client",
        "branch": "master",
        "commit_date": "1482175115",
        "rev": "dbb3fdec26373f8e86c9ea0057ebba48581ff476",
        "url": "https://github.com/joyent/mdata-client.git"
    },
    {
        "repo": "ur-agent",
        "branch": "master",
        "commit_date": "1571591123",
        "rev": "6eee05e13ff33d2e1913d7ce9c9ff4b89bbd0122",
        "url": "https://github.com/joyent/sdc-ur-agent.git"
    }
]