Discussion:
bug#17501: ARM cast-align Error
Nathan Royce
2014-05-15 19:01:53 UTC
Permalink
Similar to: http://lists.gnu.org/archive/html/bug-grep/2010-10/msg00020.html" CC memchr.omemchr.c: In function 'rpl_memchr':memchr.c:84:18: error: cast increases required alignment of target type [-Werror=cast-align] longword_ptr = (const longword *) char_ptr; ^cc1: all warnings being treated as errorsmake[3]: *** [memchr.o] Error 1"commit 3b301a71d94eec362f00905be9d2fa2b044f6f83
It was working with previous commits such as commit a46b95cb3f5a1b6e399a48cc0f554c1df1371b21
Paul Eggert
2014-05-16 02:19:44 UTC
Permalink
Post by Nathan Royce
Similar to: http://lists.gnu.org/archive/html/bug-grep/2010-10/msg00020.html"
CC memchr.o
memchr.c: In function 'rpl_memchr':memchr.c:84:18: error: cast increases required alignment of target type [-Werror=cast-align]
Unless you're on a weird machine (e.g., not byte addressible), I
wouldn't worry about that. I'd worry more about why 'configure' decided
that memchr doesn't work on your machine. What's up with that? What
does config.log say?

I suggest running 'configure' without using the '--enable-gcc-warnings'
option, and/or building without -Werror. --enable-gcc-warnings and/or
-Werror work only on reasonably-recent-and-reliable platforms.
Nathan
2014-05-16 02:25:16 UTC
Permalink
This post might be inappropriate. Click to display it.
Paul Eggert
2014-05-16 02:32:22 UTC
Permalink
Post by Nathan
What I ended up doing was just sed-ing configure to wipe out Wcast-align.
Quite possibly you have another configuration problem lurking in there
somewhere, I'm afraid. 'configure' is supposed to put -Wcast-align into
CFLAGS only if you specify the --enable-gcc-warnings option, and you
didn't do that, so I suggest getting to the bottom of why -Wcast-align
was used. My guess is that you have some global options set somewhere
with --enable-gcc-warnings, and they may be messing up other things.
But it's just a guess.
Nathan
2014-05-16 02:58:49 UTC
Permalink
git log
commit 3b301a71d94eec362f00905be9d2fa2b044f6f83
arm-linux-gnueabihf-gcc -v
Reading specs from
/home/vboxadmin/Desktop/CLFS/cross-tools/bin/../lib/gcc/arm-linux-gnueabihf/4.10.0/specs
COLLECT_GCC=arm-linux-gnueabihf-gcc
COLLECT_LTO_WRAPPER=/home/vboxadmin/Desktop/CLFS/cross-tools/bin/../libexec/gcc/arm-linux-gnueabihf/4.10.0/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../gcc/configure --prefix=/cross-tools
--build=x86_64-cross-linux-gnu --host=x86_64-cross-linux-gnu
--target=arm-linux-gnueabihf --with-sysroot=/home/vboxadmin/Desktop/CLFS
--with-local-prefix=/arm-linux-gnueabihf
--with-native-system-header-dir=/arm-linux-gnueabihf/include --disable-nls
--enable-shared --disable-static --enable-languages=c,c++
--enable-__cxa_atexit --enable-c99 --enable-long-long
--enable-threads=posix --disable-multilib --with-mpfr=/cross-tools
--with-gmp=/cross-tools --with-isl=/cross-tools --with-cloog=/cross-tools
--with-mpc=/cross-tools --with-arch=armv7-a --with-float=hard
--with-fpu=neon --disable-isl-version-check --with-system-zlib
--enable-checking=release --enable-libstdcxx-time AR=ar
'CFLAGS_FOR_BUILD=-O3 -pipe -march=corei7 -mtune=corei7 -D__ARM_PCS_VFP'
'CXXFLAGS_FOR_BUILD=-O3 -pipe -march=corei7 -mtune=corei7 -D__ARM_PCS_VFP'
'CFLAGS_FOR_TARGET=-O3 -pipe' 'CXXFLAGS_FOR_TARGET=-O3 -pipe'
LDFLAGS='-L/cross-tools/lib -Wl,-rpath -Wl,/cross-tools/lib'
Thread model: posix
gcc version 4.10.0 20140513 (experimental) (GCC)
git clean -xdf
git reset --hard
./bootstrap --no-git --skip-po //skipping git and po only for this example
./configure --prefix=/${CLFS_TARGET} --build=${CLFS_HOST}
--host=${CLFS_TARGET} --without-included-regex --quiet
CFLAGS="${targetCFLAGS}" CXXFLAGS="${targetCXXFLAGS}"
LDFLAGS="${targetLDFLAGS}" CPPFLAGS="${targetCPPFLAGS}"
make 2>&1 | tee make.log
I've attached the configure, config.log, Makefile and make.log
Looking at "configure", I was looking for an if-fi in that area, especially
thinking it would be easier to figure out considering it was indented. Then
I saw gl_manywarn_set led to ws and it was starting to look like it would
just get harder for me to find, rather than the one who surrounds himself
with these types of files.
Quite possibly you have another configuration problem lurking in there
somewhere, I'm afraid. 'configure' is supposed to put -Wcast-align into
CFLAGS only if you specify the --enable-gcc-warnings option, and you didn't
do that, so I suggest getting to the bottom of why -Wcast-align was used.
My guess is that you have some global options set somewhere with
--enable-gcc-warnings, and they may be messing up other things. But it's
just a guess.
Paul Eggert
2014-05-16 04:36:21 UTC
Permalink
What can I say? You've got a big hairy cross-build that isn't working
right. For example, it claims memchr doesn't work, when I'm pretty sure
it does. Cross-builds tend to be not well debugged, and if you really
want to do one you're going to have to bird-dog it yourself. For
example, you can set gl_cv_func_memchr_works=yes in your environment
before running 'configure', so that 'configure' doesn't mistakenly think
that memchr is broken.

You should also figure out on your own why 'configure' is deciding to
use -Werror -- normally it doesn't -- and fix that too.

There are probably a dozen other things that need to be fixed.
Nathan
2014-05-16 04:43:36 UTC
Permalink
Too funny. Good input too, especially with that gl_cv_func_memchr_wrks as
I've had to do that with a few other packages and I had forgotten about
that option.
It probably won't be worth debugging since I'm just trying to cross-build
the minimum amount, enough to get it up and then rebuild all of it from the
ARM device itself.
It also probably doesn't help that I'm trying to use the latest (and
greatest?) of every package I come across.

Thanks for that heads-up.
Post by Paul Eggert
What can I say? You've got a big hairy cross-build that isn't working
right. For example, it claims memchr doesn't work, when I'm pretty sure it
does. Cross-builds tend to be not well debugged, and if you really want to
do one you're going to have to bird-dog it yourself. For example, you can
set gl_cv_func_memchr_works=yes in your environment before running
'configure', so that 'configure' doesn't mistakenly think that memchr is
broken.
You should also figure out on your own why 'configure' is deciding to use
-Werror -- normally it doesn't -- and fix that too.
There are probably a dozen other things that need to be fixed.
Nathan
2014-05-16 17:02:35 UTC
Permalink
Just putting it out there that appending "-w" to CFLAGS will suppress
werror (warnings) and "make" will finish.
Paul Eggert
2014-05-17 00:37:51 UTC
Permalink
Post by Nathan
Just putting it out there that appending "-w" to CFLAGS will suppress
werror (warnings) and "make" will finish.
Glad you found a workaround; closing the bug report.

Loading...