utimes: Export utimensat based utimes

sys/time.h has libc_hidden_proto(utimes) which generates the hidden
"__GI_utimes" symbol reference, and common/utimes.c has a
libc_hidden_def(utimes) which generates the exported "utimes" alias.

As part of no-legacy-syscall kernel ABI, Commit 80dc2ed05
"utimes: Use utimensat if arch does not have the utimes syscall"
introduced a new wrapper, but missed the corresponding libc_hidden_def,
causing Busybox (1.20.0) link to fail (for ARC).

Also don't generate a STUB, in that case.
---------------->8-------------------
....
touch.c:(.text.touch_main+0xdc): undefined reference to `utimes'
touch.c:(.text.touch_main+0x114): undefined reference to `utimes'
libbb/lib.a(copy_file.o): In function `copy_file':
copy_file.c:(.text.copy_file+0x446): undefined reference to `utimes'
collect2: ld returned 1 exit status
---------------->8-------------------

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
leek: if lseek syscall is not available, use lseek64 even for !LFS

With Busybox and uClibc - both built w/o LFS, this caused ash to be
completely broken, as lseek was simply returning error.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
fstat64: Fix Build warnings with common-generic ABI build

  CC libc/sysdeps/linux/common/fstat64.os
In file included from libc/sysdeps/linux/common/fstat64.c:16:
libc/sysdeps/linux/common/xstatconv.h:28: warning: 'struct kernel_stat'
declared inside parameter list
libc/sysdeps/linux/common/xstatconv.h:28: warning: its scope is only
this definition or declaration, which is probably not what you want
libc/sysdeps/linux/common/fstat64.c: In function 'fstat64':
libc/sysdeps/linux/common/fstat64.c:33: warning: passing argument 2 of
'__syscall_fstat64' from incompatible pointer type
libc/sysdeps/linux/common/fstat64.c:18: note: expected 'struct stat *'
but argument is of type 'struct stat64 *'
-------------------------------------------------------------------

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
libc/ipc: Make IPC_64 0 for common-generic ABI

This avoids having to define __IPC_64 to 0 in each arch using the ABI

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
libpthread: linuxthreads.old: Allow building for no-legacy-syscalls ABI

Since NPTL port to an ARCH can be non-trivial, we must allow the legacy
pthread lib to be built for the common-generic syscall ABI

Note that only linuxthreads.old is allowed, since "newer" linuxthreads
relies on sysctl which the ABI no longer provides.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
ldso: Fix Build warnings with common-generic ABI build

  CC ldso/ldso/ldso.oS
In file included from ./ldso/include/ldso.h:47,
                 from ldso/ldso/ldso.c:33:
./ldso/include/dl-syscall.h:35:1: warning: "S_ISUID" redefined
In file included from ./include/bits/kernel_stat.h:10,
                 from ./ldso/include/dl-syscall.h:31,
                 from ./ldso/include/ldso.h:47,
                 from ldso/ldso/ldso.c:33:
./include/sys/stat.h:163:1: warning: this is the location of the
previous definition
In file included from ./ldso/include/ldso.h:47,
                 from ldso/ldso/ldso.c:33:
./ldso/include/dl-syscall.h:36:1: warning: "S_ISGID" redefined
In file included from ./include/bits/kernel_stat.h:10,
                 from ./ldso/include/dl-syscall.h:31,
                 from ./ldso/include/ldso.h:47,
                 from ldso/ldso/ldso.c:33:
./include/sys/stat.h:164:1: warning: this is the location of the
previous definition

-----------------------------------------------------------------

Cleanly seperated the legacy ABI vs. new ABI scenario.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
elf: Add ELF magic number and relocations for the Meta architecture

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
ldd: Add MATCH_MACHINE definition for Meta

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Add support for the Meta architecture

Meta cores are 32-bit, hardware multithreaded, general purpose, embedded
processors which also feature a DSP instruction set, and can be found in
many digital radios. They are capable of running different operating
systems on different hardware threads, for example a digital radio might
run RTOSes for DAB decoding and audio decoding on 3 hardware threads,
and run Linux on the 4th hardware thread to manage the user interface,
networking etc. HTPs are also capable of running SMP Linux on multiple
hardware threads.

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
libm: Add support for the Meta architecture

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
metag: Add support for loading shared objects into core memories.

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
extra/locale: Mark __codeset_8_bit_t as packed for Meta

gen_ldc writes offsets into the __locale_mmap_t structure. This
relies on the host system having the same struct offsets as the
target. On Meta, the structs are always aligned to a multiple of
4 bytes, and for these targets it is required for the struct to
be packed so that it is more likely to match the host system
(typically x86 which does not align structs).

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
metag: Add NPTL support

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
test: compile test{,_glibc} adjacent

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
test: cater for config

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
buildsys: tweak KCONFIG_CONFIG export

0c3eb2da578bc7ba2e74d240e3249dce62ec725e moved KCONFIG_CONFIG around and
that broke propagation of config-settings to the testsuite. Fix that.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
buildsys: remove surplus slashes from test dir paths

cosmetics

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
test: dlopen: fix misplaced buildsys hunk

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
inet: res_nclose: free user-buffer, not global _res

In res_iclose we were operating on the global _res even if called via
res_nclose where we are supposed to operate on the user provided
res_state.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
libc: switch several users to unlikely()

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>