Solaris build error: Bad string

Bug #1787012 reported by Michele Denber
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QEMU
Invalid
Undecided
Unassigned

Bug Description

While building qemu2.12.0 on a Sun Oracle Enterprise M3000 SPARC64 VII running Solaris 10U11, opencsw toolchain, gcc 7.3.0, and python 3.3.6 I get:

# gmake
mkdir -p dtc/libfdt
mkdir -p dtc/tests
Bad string
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/dumptrees.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/trees.S
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/testutils.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/value-labels.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/asm_tree_dump.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/truncated_property.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/check_path.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/overlay_bad_fixup.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/overlay.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/subnode_iterate.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/property_iterate.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/integer-expressions.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/utilfdt_test.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/path_offset_aliases.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/add_subnode_with_nops.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/dtbs_equal_unordered.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/dtb_reverse.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/dtbs_equal_ordered.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/extra-terminating-null.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/incbin.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/boot-cpuid.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/phandle_format.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/path-references.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/references.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/string_escapes.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/propname_escapes.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/appendprop2.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/appendprop1.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/del_node.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/del_property.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/setprop.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/set_name.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/rw_tree1.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/open_pack.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/nopulate.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/mangle-layout.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/move_and_save.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/sw_tree1.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/nop_node.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/nop_property.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/setprop_inplace.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/stringlist.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/addr_size_cells.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/notfound.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/sized_cells.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/char_literal.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/get_alias.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/node_offset_by_compatible.c DEP /export/home/denber/qemu-2.12.0/dtc/tests/node_check_compatible.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/node_offset_by_phandle.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/node_offset_by_prop_value.c DEP /export/home/denber/qemu-2.12.0/dtc/tests/parent_offset.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/supernode_atdepth_offset.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/get_path.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/get_phandle.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/getprop.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/get_name.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/path_offset.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/subnode_offset.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/find_property.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/root_node.c
         DEP /export/home/denber/qemu-2.12.0/dtc/tests/get_mem_rsv.c
         DEP /export/home/denber/qemu-2.12.0/dtc/libfdt/fdt_overlay.c
         DEP /export/home/denber/qemu-2.12.0/dtc/libfdt/fdt_addresses.c
         DEP /export/home/denber/qemu-2.12.0/dtc/libfdt/fdt_empty_tree.c
         DEP /export/home/denber/qemu-2.12.0/dtc/libfdt/fdt_strerror.c
         DEP /export/home/denber/qemu-2.12.0/dtc/libfdt/fdt_rw.c
         DEP /export/home/denber/qemu-2.12.0/dtc/libfdt/fdt_sw.c
         DEP /export/home/denber/qemu-2.12.0/dtc/libfdt/fdt_wip.c
         DEP /export/home/denber/qemu-2.12.0/dtc/libfdt/fdt_ro.c
         DEP /export/home/denber/qemu-2.12.0/dtc/libfdt/fdt.c
         DEP /export/home/denber/qemu-2.12.0/dtc/util.c
         DEP /export/home/denber/qemu-2.12.0/dtc/fdtoverlay.c
         DEP /export/home/denber/qemu-2.12.0/dtc/fdtput.c
         DEP /export/home/denber/qemu-2.12.0/dtc/fdtget.c
         DEP /export/home/denber/qemu-2.12.0/dtc/fdtdump.c
         DEP convert-dtsv0-lexer.lex.c
         DEP /export/home/denber/qemu-2.12.0/dtc/srcpos.c
         DEP dtc-parser.tab.c
         DEP dtc-lexer.lex.c
         DEP /export/home/denber/qemu-2.12.0/dtc/treesource.c
         DEP /export/home/denber/qemu-2.12.0/dtc/livetree.c
         DEP /export/home/denber/qemu-2.12.0/dtc/fstree.c
         DEP /export/home/denber/qemu-2.12.0/dtc/flattree.c
         DEP /export/home/denber/qemu-2.12.0/dtc/dtc.c
         DEP /export/home/denber/qemu-2.12.0/dtc/data.c
         DEP /export/home/denber/qemu-2.12.0/dtc/checks.c
Bad string
         CC libfdt/fdt.o
         CC libfdt/fdt_ro.o
         CC libfdt/fdt_wip.o
         CC libfdt/fdt_sw.o
         CC libfdt/fdt_rw.o
         CC libfdt/fdt_strerror.o
         CC libfdt/fdt_empty_tree.o
         CC libfdt/fdt_addresses.o
         CC libfdt/fdt_overlay.o
         AR libfdt/libfdt.a
a - libfdt/fdt.o
a - libfdt/fdt_ro.o
a - libfdt/fdt_wip.o
a - libfdt/fdt_sw.o
a - libfdt/fdt_rw.o
a - libfdt/fdt_strerror.o
a - libfdt/fdt_empty_tree.o
a - libfdt/fdt_addresses.o
a - libfdt/fdt_overlay.o
ar: creating libfdt/libfdt.a
ar: writing libfdt/libfdt.a
...

gmake then completes, returning just a "#" prompt and no error messages. However, no executable is created. Apparently, "Bad string" is the problem, but it is unclear what that means and where the two instances of it are coming from. A web search for this problem returned nothing.

Revision history for this message
Michele Denber (michele31415) wrote :

[Solved]

There's nothing like going public with a problem to find the answer yourself shortly after. In case it helps someone else in the future, it turns out that the Makefile in dtc/ contains the following line:

HOSTOS := $(shell uname -s | tr '[:upper:]' '[:lower:]' | \
   sed -e 's/\(cygwin\|msys\).*/\1/')

Apparently there's something in there that gmake doesn't like which causes it to emit "Bad string" so I just replaced that line with:

HOSTOS=SunOS

(a call to uname -s from the command line returns SunOS) and I'm no longer getting the "Bad string" from gmake. (I'm getting soemthing else now but that's a different matter).

Revision history for this message
Michele Denber (michele31415) wrote :

Oh, and how I found this. From http://lists.xymon.com/archive/2012-July/035109.html:

> Sorry to reply to myself. Looks like this line:
>
> uname -s | tr '[/]' '[_]'
>
> ...is not acceptable to /usr/bin/tr on Solaris 10. It worked fine
> on 9. On 10, one receives this error:
>
> # uname -s | tr '[/]' '[_]' Bad string

And indeed I get:

# uname -s | tr '[/]' '[_]'
Bad string
#

So this is a bug in the Makefile, but only for Solaris 10.

Revision history for this message
Daniel Berrange (berrange) wrote :

It sounds more like a bug / limited featureset in the Solaris 'tr' binary.

What is your $PATH ? Make sure /usr/xpg4/bin directory appears *before* /usr/bin in $PATH to get a more functional version of 'tr', though I'm not sure if that'll fix it or not.

Revision history for this message
Michele Denber (michele31415) wrote :

You are absolutely correct. I found the right problem but the wrong reason. Note that:

# which tr
/usr/bin/tr
# uname -s | tr '[/]' '[_]'
Bad string
# uname -s | /usr/xpg4/bin/tr '[/]' '[_]'
SunOS
#

So it's just another POSIX problem with Solaris, not a bug. Solaris provides all the POSIX stuff, it just doesn't make it the default.

Changed in qemu:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.