misc.h: Fix hwloc_strncasecmp() build under strict flags on BSD

strncasecmp() needs <strings.h>

Thanks to Pavan Balaji for reporting the failure.

(cherry picked from commit 37439c4801f2f69f83599df3d6254df0aabebeb5)
misc.h: Fix hwloc_strncasecmp() with some icc

tolower needs <ctype.h>

Thanks to Ralph Castain for reporting the failure.

(cherry picked from commit 038c372a58da0a3e4b134459f19194853c8b7769)
Use gcc's __asm__ version of the asm extension, which can be used in all standards

(cherry picked from commit b15d76c3379982346a87f1e908b55d150b06240f)
errors: improve the advice to send hwloc-gather-topology files in the OS error message

(cherry picked from commit f77aa01b3c23181107162ac2c8f6155c62d7c798)
x86 and OSF: Don't forget to set NUMA node nodeset

x86: Not critical since BSDs that use this backend have no membind support,
but better fix it for uniformization.
(cherry picked from commit a431361c7d2a3772ea7a2ffee922b3cf61e858cd)

OSF: Looks like nobody ever tried to play with memory binding on OSF/Tru64.
(cherry picked from commit 2d6c73356d8d2dd7a22b99b3d51fbecb002e77b9)

Conflicts:
	NEWS
cpuid-x86: Fix duplicate asm labels in case of heavy inlining on x86-32

hwloc_x86_discover() calls hwloc_look_x86() twice, which calls hwloc_have_x86_cpuid().
If everything gets inlined, the asm label inside hwloc_have_x86_cpuid()
is duplicated.
Use a local label with f annotation in jumps to avoid the problem.

Thanks to Thomas Van Doren for reporting the issue (found with gcc -m32).

(cherry picked from commit 50e447f5bc6db88aefdc2f7e55dd43c6f575c870)
debug: fix an overzealous assertion about the parent cpuset vs its children

When I/O are attached under a PU, removing the children's cpusets from
the parent cpuset doesn't give 0, it gives the PU cpuset.
The assertion fails on single-pu machines with I/O when --merge is given,
only one PU remains with I/O under it.

But if we insert Misc by cpuset under PU, it gives 0 as expected.

Fix the assertion accordingly.

Thanks to Thomas Van Doren for reporting the issue.

(cherry picked from commit 45c94c336d828210b2e7fe8cfd6c528066567bc5)
core: fix the merging of identical objects in presence of Misc objects

If object A contains B + I/O as children, we can "ignore" I/Os and still
try to merge A and B. We now do the same for Misc objects without cpusets
instead of I/Os.

This fixes a corner case when export/reimport to XML creates a slightly
different topology (making hwloc_insert_misc fail inside a Linux cgroup).

Thanks to Dave Love for reporting the problem.

Fixes #118

(cherry picked from commit 650371e1159fb3826afae8842545c4d16bdad1c8)
core: reorder children in merge_useless_child() as well

When ignore_keep_structure is enabled, intermediate level can disappear
between parent and child, making the new child complete_cpuset smaller,
causing the child list to require a reorder just like in remove_ignored().

(cherry picked from commit 88afbe6b62d1fae99bf36b8f03e26eff37f08240)

Embed this related commit:
core: abstract out reorder_children(), needed when merging modifies the list of children
(cherry picked from commit 14db82d3917c5de40dfe12ead316f3fc602197f4)
hpux: improve hwloc_hpux_find_ldom() looking for NUMA node

hwloc_get_first_largest_obj_inside_cpuset() returns the largest/highest object,
but it could still have a child with the same cpuset.
So check children as well in case there's a matching NUMA node there.

(cherry picked from commit 57a1c4fbe4bc83a6d65b2e752cc7f8b6f28bddc7)
x86: use ulong for cache sizes, uint won't be enough in the near future

(cherry picked from commit ae825977730c7d6b88ccab744e777cace3586c06)
x86: use Group instead of Misc for unknown x2apic levels

Misc are reserved for annotating the topology, the core
doesn't like merging them. Group is more appropriate.

(cherry picked from commit 3c476495912979ef6967c4d1db80d2657df2c347)