Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 261070 - updating mingw package like normal uses host ABI rather than cross-ABI
Summary: updating mingw package like normal uses host ABI rather than cross-ABI
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: High normal with 1 vote (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
: 271788 292696 335668 346469 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-03-03 14:44 UTC by Thomas Capricelli
Modified: 2010-11-23 01:56 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
output of crossdev (cross-mingw32-info.log,11.36 KB, text/plain)
2009-03-14 16:15 UTC, Thomas Capricelli
Details
gcc output (cross-mingw32-gcc-stage2.log,934.82 KB, text/plain)
2009-03-14 16:16 UTC, Thomas Capricelli
Details
gcc-4.3.3/work/build/mingw32/libstdc++-v3/config.log (config.log,131.65 KB, text/plain)
2009-03-14 16:40 UTC, Thomas Capricelli
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Capricelli 2009-03-03 14:44:57 UTC
for quite some time (~2 months?), this package fails to update on my regular updates. The error is not obvious reading the log.
Today i did 'crossdev mingw32' to start from scratch. it still fails on gcc. 
digging into the log i've found that line:

"checking for ld that supports -Wl,--gc-sections... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES." which might be the reason.

Also, there's a strange statement about overlay 'voip'. i use this overlay, but fail to see how it relates to mingw32-gcc.




Reproducible: Always

Actual Results:  
end of log:
.....
if [ x"" != x ]; then \                                                                                                                                                                
          cd pic; \                                                                                                                                                                    
          /usr/libexec/gcc/mingw32/ar rc ./libiberty.a \                                                                                                                               
            ./regex.o ./cplus-dem.o ./cp-demangle.o ./md5.o ./alloca.o ./argv.o ./choose-temp.o ./concat.o ./cp-demint.o ./dyn-string.o ./fdmatch.o ./fibheap.o ./filename_cmp.o ./floatformat.o ./fnmatch.o ./fopen_unlocked.o ./getopt.o ./getopt1.o ./getpwd.o ./getruntime.o ./hashtab.o ./hex.o ./lbasename.o ./lrealpath.o ./make-relative-prefix.o ./make-temp-file.o ./objalloc.o ./obstack.o ./partition.o ./pexecute.o ./physmem.o ./pex-common.o ./pex-one.o ./pex-win32.o ./safe-ctype.o ./sort.o ./spaces.o ./splay-tree.o ./strerror.o ./strsignal.o ./unlink-if-ordinary.o ./xatexit.o ./xexit.o ./xmalloc.o ./xmemdup.o ./xstrdup.o ./xstrerror.o ./xstrndup.o  ./asprintf.o ./basename.o ./bcmp.o ./bcopy.o ./bzero.o ./clock.o ./ffs.o ./getpagesize.o ./index.o ./insque.o ./mempcpy.o ./mkstemps.o ./random.o ./rindex.o ./sigsetmask.o ./stpcpy.o ./stpncpy.o ./strndup.o ./strverscmp.o ./vasprintf.o ./waitpid.o ./strncmp.o; \                                                                                                                                                                                    
          /usr/libexec/gcc/mingw32/ranlib ./libiberty.a; \                                                                                                                             
          cp ./libiberty.a ../ ; \                                                                                                                                                     
          cd ..; \                                                                                                                                                                     
        else true; fi                                                                                                                                                                  
make[3]: Entering directory `/tmp/portage/cross-mingw32/gcc-4.3.3/work/build/mingw32/libiberty'                                                                                        
if [ -z "" ]; then \                                                                                                                                                                   
          true; \                                                                                                                                                                      
        else \                                                                                                                                                                         
          rootpre=`${PWDCMD-pwd}`/; export rootpre; \                                                                                                                                  
          srcrootpre=`cd /tmp/portage/cross-mingw32/gcc-4.3.3/work/gcc-4.3.3/libiberty; ${PWDCMD-pwd}`/; export srcrootpre; \                                                          
          lib=`echo "${rootpre}" | sed -e 's,^.*/\([^/][^/]*\)/$,\1,'`; \                                                                                                              
          compiler="/tmp/portage/cross-mingw32/gcc-4.3.3/work/build/./gcc/xgcc -B/tmp/portage/cross-mingw32/gcc-4.3.3/work/build/./gcc/ -L/tmp/portage/cross-mingw32/gcc-4.3.3/work/build/mingw32/winsup/mingw -L/tmp/portage/cross-mingw32/gcc-4.3.3/work/build/mingw32/winsup/w32api/lib -isystem /tmp/portage/cross-mingw32/gcc-4.3.3/work/gcc-4.3.3/winsup/mingw/include -isystem /tmp/portage/cross-mingw32/gcc-4.3.3/work/gcc-4.3.3/winsup/w32api/include -B/usr/mingw32/bin/ -B/usr/mingw32/lib/ -isystem /usr/mingw32/include -isystem /usr/mingw32/sys-include"; \                                                                                                                                                                                 
          for i in `${compiler} --print-multi-lib 2>/dev/null`; do \                                                                                                                   
            dir=`echo $i | sed -e 's/;.*$//'`; \                                                                                                                                       
            if [ "${dir}" = "." ]; then \                                                                                                                                              
              true; \                                                                                                                                                                  
            else \                                                                                                                                                                     
              if [ -d ../${dir}/${lib} ]; then \                                                                                                                                       
                flags=`echo $i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \                                                                                                                
                if (cd ../${dir}/${lib}; make "AR=/usr/libexec/gcc/mingw32/ar" "AR_FLAGS=rc" "CC=/tmp/portage/cross-mingw32/gcc-4.3.3/work/build/./gcc/xgcc -B/tmp/portage/cross-mingw32/gcc-4.3.3/work/build/./gcc/ -L/tmp/portage/cross-mingw32/gcc-4.3.3/work/build/mingw32/winsup/mingw -L/tmp/portage/cross-mingw32/gcc-4.3.3/work/build/mingw32/winsup/w32api/lib -isystem /tmp/portage/cross-mingw32/gcc-4.3.3/work/gcc-4.3.3/winsup/mingw/include -isystem /tmp/portage/cross-mingw32/gcc-4.3.3/work/gcc-4.3.3/winsup/w32api/include -B/usr/mingw32/bin/ -B/usr/mingw32/lib/ -isystem /usr/mingw32/include -isystem /usr/mingw32/sys-include" "CFLAGS=-O2 -g -O2 -pipe  " "DESTDIR=" "LIBCFLAGS=-O2 -g -O2 -pipe  " "EXTRA_OFILES=" "HDEFINES=" "INSTALL=/usr/bin/install -c" "INSTALL_DATA=/usr/bin/install -c -m 644" "INSTALL_PROGRAM=/usr/bin/install -c" "LDFLAGS=" "LOADLIBES=" "RANLIB=/usr/libexec/gcc/mingw32/ranlib" "SHELL=/bin/sh" "prefix=/usr" "exec_prefix=/usr" "libdir=/usr/lib" "libsubdir=" "tooldir=/usr/mingw32" \                                                                                           
                                CFLAGS="-O2 -g -O2 -pipe   ${flags}" \                                                                                                                 
                                CCASFLAGS=" ${flags}" \                                                                                                                                
                                FCFLAGS=" ${flags}" \                                                                                                                                  
                                FFLAGS=" ${flags}" \                                                                                                                                   
                                ADAFLAGS=" ${flags}" \                                                                                                                                 
                                prefix="/usr" \                                                                                                                                        
                                exec_prefix="/usr" \                                                                                                                                   
                                GCJFLAGS="-O2 -pipe ${flags}" \                                                                                                                        
                                CXXFLAGS="-O2 -g    ${flags}" \
                                LIBCFLAGS="-O2 -g -O2 -pipe   ${flags}" \
                                LIBCXXFLAGS="-O2 -g    -fno-implicit-templates ${flags}" \
                                LDFLAGS=" ${flags}" \
                                MULTIFLAGS="${flags}" \
                                DESTDIR="" \
                                INSTALL="/usr/bin/install -c" \
                                INSTALL_DATA="/usr/bin/install -c -m 644" \
                                INSTALL_PROGRAM="/usr/bin/install -c" \
                                INSTALL_SCRIPT="/usr/bin/install -c" \
                                all); then \
                  true; \
                else \
                  exit 1; \
                fi; \
              else true; \
              fi; \
            fi; \
          done; \
        fi
make[3]: Leaving directory `/tmp/portage/cross-mingw32/gcc-4.3.3/work/build/mingw32/libiberty'
make[2]: Leaving directory `/tmp/portage/cross-mingw32/gcc-4.3.3/work/build/mingw32/libiberty'
make[1]: Leaving directory `/tmp/portage/cross-mingw32/gcc-4.3.3/work/build'
make: *** [all] Error 2
 *
 * ERROR: cross-mingw32/gcc-4.3.3 failed.


emerge --info : 
Portage 2.2_rc23 (default/linux/amd64/2008.0, gcc-4.3.3, glibc-2.9_p20081201-r2, 2.6.28.7-dirty x86_64)
=================================================================                                      
System uname: Linux-2.6.28.7-dirty-x86_64-AMD_Athlon-tm-_64_X2_Dual_Core_Processor_4200+-with-glibc2.2.5
Timestamp of tree: Tue, 03 Mar 2009 00:15:01 +0000                                                      
distcc 3.1 x86_64-pc-linux-gnu [disabled]                                                               
ccache version 2.4 [disabled]                                                                           
app-shells/bash:     3.2_p48-r1                                                                         
dev-java/java-config: 1.3.7-r1, 2.1.7                                                                   
dev-lang/python:     2.5.4-r2                                                                           
dev-python/pycrypto: 2.0.1-r7                                                                           
dev-util/ccache:     2.4-r8                                                                             
dev-util/cmake:      2.6.3                                                                              
sys-apps/baselayout: 2.0.0                                                                              
sys-apps/openrc:     0.4.3-r1                                                                           
sys-apps/sandbox:    1.3.8
Comment 1 emerald 2009-03-03 21:00:46 UTC
I had the same problem some time ago with cross-i686-mingw32-msvc and after a 
hint to just try cross-i686-mingw32 i managed to build the compiler 
successfully.
Comment 2 SpanKY gentoo-dev 2009-03-14 15:40:06 UTC
builds fine for me.  post all the logs crossdev told you to as attachments.

# crossdev mingw32
* Host Portage ARCH:     amd64
* Target Portage ARCH:   *
* Target System:         mingw32
* Stage:                 4 (C/C++ compiler)

* binutils:              binutils-[latest]
* gcc:                   gcc-[latest]
* headers:               w32api-[latest]
* libc:                  mingw-runtime-[latest]

* PORTDIR_OVERLAY:       /usr/local/portage
* PORT_LOGDIR:           /var/log/portage
* PKGDIR:                /usr/portage/packages/cross/mingw32
* PORTAGE_TMPDIR:        /var/tmp/cross/mingw32
* Forcing the latest versions of {binutils,gcc}-config/gnuconfig...   [ ok ]
* Log: /var/log/portage/cross-mingw32-binutils.log
* Emerging cross-binutils...                                          [ ok ]
* Log: /var/log/portage/cross-mingw32-w32api-quick.log
* Emerging cross-w32api-quick...                                      [ ok ]
* Log: /var/log/portage/cross-mingw32-mingw-runtime-headers.log
* Emerging cross-mingw-runtime-headers...                             [ ok ]
* Log: /var/log/portage/cross-mingw32-gcc-stage1.log
* Emerging cross-gcc-stage1...                                        [ ok ]
* Log: /var/log/portage/cross-mingw32-w32api.log
* Emerging cross-w32api...                                            [ ok ]
* Log: /var/log/portage/cross-mingw32-mingw-runtime.log
* Emerging cross-mingw-runtime...                                     [ ok ]
* Log: /var/log/portage/cross-mingw32-gcc-stage2.log
* Emerging cross-gcc-stage2...                                        [ ok ]
Comment 3 Thomas Capricelli 2009-03-14 15:59:30 UTC
i understand the statement about voip
crossdev does:
    PORTDIR_OVERLAYS=$(portageq envvar PORTDIR_OVERLAY)
and portageq gives on my system:
/usr/local/portage/layman/voip /usr/local/portage/layman/kde-testing /usr/local/portage/layman/science

and crossdev only displays the first entry :
...
* PORTDIR_OVERLAY:       /usr/local/portage/layman/voip
...


Now i'm wondering why this (wrong) PORTDIR_OVERLY is used all over the crossdev script. I can't say as i dont understand much of it.
Comment 4 Thomas Capricelli 2009-03-14 16:00:33 UTC
ouch, that's the place where things are getting built... very strange:
everything is under /usr/local/portage/layman/voip/cross-mingw32
Comment 5 Thomas Capricelli 2009-03-14 16:15:30 UTC
Created attachment 184963 [details]
output of crossdev

here's one
Comment 6 Thomas Capricelli 2009-03-14 16:16:32 UTC
Created attachment 184965 [details]
gcc output

second one
Comment 7 Thomas Capricelli 2009-03-14 16:17:06 UTC
And here is the command line output:

orzel@berlioz /home/orzel% sudo crossdev mingw32
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* Host Portage ARCH:     amd64
* Target Portage ARCH:   *
* Target System:         mingw32
* Stage:                 4 (C/C++ compiler)

* binutils:              binutils-[latest]
* gcc:                   gcc-[latest]
* headers:               w32api-[latest]
* libc:                  mingw-runtime-[latest]

* PORTDIR_OVERLAY:       /usr/local/portage/layman/voip
* PORT_LOGDIR:           /var/log/portage
* PKGDIR:                /usr/portage/packages/cross/mingw32
* PORTAGE_TMPDIR:        /var/tmp/cross/mingw32
  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _
* Forcing the latest versions of {binutils,gcc}-config/gnuconfig...                                                                                                                [ ok ]
* Log: /var/log/portage/cross-mingw32-binutils.log
* Emerging cross-binutils...                                                                                                                                                       [ ok ]
* Log: /var/log/portage/cross-mingw32-w32api-quick.log
* Emerging cross-w32api-quick...                                                                                                                                                   [ ok ]
* Log: /var/log/portage/cross-mingw32-mingw-runtime-headers.log
* Emerging cross-mingw-runtime-headers...                                                                                                                                          [ ok ]
* Log: /var/log/portage/cross-mingw32-gcc-stage1.log
* Emerging cross-gcc-stage1...                                                                                                                                                     [ ok ]
* Log: /var/log/portage/cross-mingw32-w32api.log
* Emerging cross-w32api...                                                                                                                                                         [ ok ]
* Log: /var/log/portage/cross-mingw32-mingw-runtime.log
* Emerging cross-mingw-runtime...                                                                                                                                                  [ ok ]
* Log: /var/log/portage/cross-mingw32-gcc-stage2.log
* Emerging cross-gcc-stage2...


* gcc failed :(
* If you file a bug, please attach the following logfiles:
* /var/log/portage/cross-mingw32-info.log
* /var/log/portage/cross-mingw32-gcc-stage2.log
Comment 8 SpanKY gentoo-dev 2009-03-14 16:27:23 UTC
crossdev needs an overlay, so it picks the first one you have listed

post the config.log as an attachment from configure-target-libstdc++-v3 as that is the error

configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES.
Comment 9 Thomas Capricelli 2009-03-14 16:40:18 UTC
Created attachment 184967 [details]
gcc-4.3.3/work/build/mingw32/libstdc++-v3/config.log

I hope this is the good file : i did 
find -name config.log | xargs grep -l libstdc++-v3
from /tmp/cross/mingw32/portage/cross-mingw32

Note that, in hope to help, i had already extracted this error line from the logs, see my original bug report.

(also, if that could be of any help, i'm available on irc as 'orzel', right now)
Comment 10 SpanKY gentoo-dev 2009-03-14 18:18:57 UTC
yes, that's the right config.log and it shows the problem

does this work for your compiler ?
$ echo 'main(){}' > test.c
$ mingw32-gcc test.c

you should of course have crt2.o at /usr/mingw32/usr/lib/crt2.o

configure:2835: /tmp/cross/mingw32/portage/cross-mingw32/gcc-4.3.3/work/build/./gcc/xgcc -B/tmp/cross/mingw32/portage/cross-mingw32/gcc-4.3.3/work/build/./gcc/ -L/tmp/cross/mingw32/portage/cross-mingw32/gcc-4.3.3/work/build/mingw32/winsup/mingw -L/tmp/cross/mingw32/portage/cross-mingw32/gcc-4.3.3/work/build/mingw32/winsup/w32api/lib -isystem /tmp/cross/mingw32/portage/cross-mingw32/gcc-4.3.3/work/gcc-4.3.3/winsup/mingw/include -isystem /tmp/cross/mingw32/portage/cross-mingw32/gcc-4.3.3/work/gcc-4.3.3/winsup/w32api/include -B/usr/mingw32/bin/ -B/usr/mingw32/lib/ -isystem /usr/mingw32/include -isystem /usr/mingw32/sys-include -o conftest -O2 -g -O2 -pipe     conftest.c  >&5
/usr/libexec/gcc/mingw32/ld: crt2.o: No such file: No such file or directory
collect2: ld returned 1 exit status
configure:2838: $? = 1
Comment 11 Thomas Capricelli 2009-03-14 23:37:10 UTC
erm.... i dont : 

orzel@berlioz /home/orzel/tmp% echo 'main(){}' > test.c
orzel@berlioz /home/orzel/tmp% mingw32-gcc test.c
/usr/libexec/gcc/mingw32/ld: crt2.o: No such file: No such file or directory
collect2: ld returned 1 exit status
orzel@berlioz /home/orzel/tmp% ll /usr/mingw32/usr/lib/crt2.o
ls: cannot access /usr/mingw32/usr/lib/crt2.o: No such file or directory

there are lot of stuff in /usr/mingw32/usr/lib, but no crt2.o

On the other hand i have one here :

orzel@berlioz /home/orzel/tmp% find /usr/mingw32/ -name crt2.o
/usr/mingw32/usr/lib64/crt2.o

I dont know about those lib / lib64 stuff, but i'm sure I have never changed anything there. I did no even know about /usr/mingw32. I was just happy that mingw32 worked :)
Comment 12 SpanKY gentoo-dev 2009-03-15 02:13:18 UTC
crossdev will set the ABI by default such that it overrides things like that, but if you set ABI in your env, you'll force the build to ignore it

do you export ABI in your normal environment ?  `echo $ABI` ?
Comment 13 Thomas Capricelli 2009-03-15 10:10:57 UTC
Nothing related to ABI in my env:
ABI: Undefined variable.

env | grep -i abi -> gives nothing

I've checked in /etc and found nothing related to 'ABI' neither.
Comment 14 SpanKY gentoo-dev 2009-03-19 03:46:06 UTC
you probably upgraded one of the packages via portage

do `crossdev -C mingw32 && crossdev mingw32`
Comment 15 Thomas Capricelli 2009-03-20 01:22:53 UTC
MM, you right, i remember having seen cross stuff in usual portage update. Is that bad ? i did not know. How am i supposed to do then ?

Now, it's a completely unrelated error (i guess) that prevent it from being emerged (after quite a long time..):

in /var/log/portage/cross-mingw32-gcc-stage1.log

   /usr/libexec/gcc/mingw32/4.3.3/cc1
   /usr/libexec/gcc/mingw32/4.3.3/collect2
>>> Completed installing gcc-4.3.3-r1 into /tmp/cross/mingw32/portage/cross-mingw32/gcc-4.3.3-r1/image/

^G
 ^[[33;01m*^[[0m QA Notice: Package has poor programming practices which may compile
 ^[[33;01m*^[[0m            fine but exhibit random runtime failures.
 ^[[33;01m*^[[0m /tmp/cross/mingw32/portage/cross-mingw32/gcc-4.3.3-r1/work/gcc-4.3.3/libgcc/../gcc/libgcov.c:817: warning: implicit declaration of function ‘fork’
^G
 ^[[33;01m*^[[0m Please do not file a Gentoo bug and instead report the above QA
 ^[[33;01m*^[[0m issues directly to the upstream developers of this software.
 ^[[33;01m*^[[0m Homepage: http://gcc.gnu.org/
 ^[[31;01m*^[[0m
 ^[[31;01m*^[[0m ERROR: cross-mingw32/gcc-4.3.3-r1 failed.
 ^[[31;01m*^[[0m Call stack:
 ^[[31;01m*^[[0m       misc-functions.sh, line 729:  Called install_qa_check
 ^[[31;01m*^[[0m       misc-functions.sh, line 428:  Called die
 ^[[31;01m*^[[0m The specific snippet of code:
 ^[[31;01m*^[[0m                hasq stricter ${FEATURES} && die "poor code kills airplanes"
 ^[[31;01m*^[[0m  The die message:
 ^[[31;01m*^[[0m   poor code kills airplanes
 ^[[31;01m*^[[0m
 ^[[31;01m*^[[0m If you need support, post the topmost build error, and the call stack if relevant.
 ^[[31;01m*^[[0m A complete build log is located at '/tmp/cross/mingw32/portage/cross-mingw32/gcc-4.3.3-r1/temp/build.log'.
 ^[[31;01m*^[[0m The ebuild environment file is located at '/tmp/cross/mingw32/portage/cross-mingw32/gcc-4.3.3-r1/temp/environment'.
 ^[[31;01m*^[[0m This ebuild is from an overlay named 'voip': '/usr/local/portage/layman/voip/'
 ^[[31;01m*^[[0m
!!! post install failed; exiting.
Comment 16 SpanKY gentoo-dev 2009-03-20 04:09:03 UTC
yes, unrelated.  use FEATURES=-stricter if you dont want those QA checks.
Comment 17 Thomas Capricelli 2009-03-23 02:17:05 UTC
where can i have information about this then ? you seem to say that updating with emerge is bad but i did not know. Why does emerge do that then ? should i report a bug on emerge ?
Comment 18 SpanKY gentoo-dev 2009-03-23 02:28:20 UTC
no.  i'll fix the mingw packages at some point.
Comment 19 SpanKY gentoo-dev 2009-06-01 23:20:23 UTC
*** Bug 271788 has been marked as a duplicate of this bug. ***
Comment 20 SpanKY gentoo-dev 2009-11-11 04:20:16 UTC
*** Bug 292696 has been marked as a duplicate of this bug. ***
Comment 21 SpanKY gentoo-dev 2009-12-24 13:14:01 UTC
crossdev now sticks the ABI settings into the per-package env and so upgrades should work fine

http://git.overlays.gentoo.org/gitweb/?p=proj/crossdev.git;a=commitdiff;h=8bba06bce04fa3124f29d3c4a2f9a5b7b10487fe
Comment 22 SpanKY gentoo-dev 2010-09-08 16:09:37 UTC
*** Bug 335668 has been marked as a duplicate of this bug. ***
Comment 23 Ralph Sennhauser (RETIRED) gentoo-dev 2010-11-01 14:53:11 UTC
(In reply to comment #21)
> crossdev now sticks the ABI settings into the per-package env and so upgrades
> should work fine
> 
> http://git.overlays.gentoo.org/gitweb/?p=proj/crossdev.git;a=commitdiff;h=8bba06bce04fa3124f29d3c4a2f9a5b7b10487fe
> 

Wouldn't it be nice to stick the ABI hack into the ebuild/eclass itself so it wouldn't have to rely on crossdev at all and would work for toolchains built with an earlier version of crossdev as well. Also there wouldn't be any additional env files not under the control of the package manager.
Comment 24 SpanKY gentoo-dev 2010-11-09 13:04:49 UTC
that isnt going to happen.  simply create/tweak the /etc/ env files yourself.
Comment 25 SpanKY gentoo-dev 2010-11-23 01:56:30 UTC
*** Bug 346469 has been marked as a duplicate of this bug. ***