Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
crossdev with MinGW : cross emerge claims existing simlinks
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
lalebarde
Guru
Guru


Joined: 03 Sep 2006
Posts: 464
Location: France, Haute-Garonne

PostPosted: Thu Jul 11, 2013 3:40 pm    Post subject: crossdev with MinGW : cross emerge claims existing simlinks Reply with quote

Hi all,

I need to set up a cross compiler environment with MinGW for building and testing my application. I have followed :


Code:
emerge -av crossdev
# switched /etc/portage/package.* to directories
# added "/usr/local/portage/cross-i686-pc-mingw32" into PORTDIR_OVERLAY
crossdev --ov-output /usr/local/portage -t i686-pc-mingw32
emerge-wrapper --init


Code:
# ls -l /usr/i686-pc-mingw32/etc/make.profile
lrwxrwxrwx 1 root root 30 11 juil. 12:08 /usr/i686-pc-mingw32/etc/make.profile -> /usr/portage/profiles/embedded


The cross compiler looks working :
Code:
$ cd test
$ echo 'int main(){return 0;}' > test.c
$ i686-pc-mingw32-gcc -Wall test.c -o test
$ file test
test: PE32 executable (console) Intel 80386 (stripped to external PDB), for MS Windows
$ wine test.exe


But when I try to cross-emerge, I have the following error :
Code:
# i686-pc-mingw32-emerge net-libs/zeromq
!!! /usr/i686-pc-mingw32/etc/make.profile is not a symlink and will probably prevent most merges.
!!! It should point into a profile within /usr/portage/profiles/
!!! (You can safely ignore this message when syncing. It's harmless.)

Calculating dependencies... done!
 * ARCH is not set... Are you missing the '/usr/i686-pc-
 * mingw32/etc/portage/make.profile' symlink? Is the symlink correct? Is
 * your portage tree complete?


Here is my cross make.conf :
Code:
CHOST=i686-pc-mingw32
CBUILD=x86_64-pc-linux-gnu
ARCH=x86
#ARCH=mingw32

HOSTCC=x86_64-pc-linux-gnu-gcc
E_MACHINE=EM_386

ROOT=/usr/${CHOST}/
# SYSROOT : http://www.gentoo.org/proj/en/base/embedded/handbook/index.xml?part=1&chap=3  §3.b, PORTAGE_CONFIGROOT §3.c
SYSROOT=$ROOT
PORTAGE_CONFIGROOT=$ROOT

ACCEPT_KEYWORDS="x86 ~x86"

USE="${ARCH} zlib bindist make-symlinks minimal"

#MARCH_TUNE="-march=armv4t -mtune=arm9tdmi"   #arm-softfloat-linux-uclibc
#MARCH_TUNE="-march=armv5t -mtune=xscale"   #armv5teb-softfloat-linux-gnueabi
MARCH_TUNE="-march=x86"

CFLAGS="-O2 -pipe ${MARCH_TUNE} -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"

FEATURES="-collision-protect sandbox buildpkg noman noinfo nodoc"
# Be sure we dont overwrite pkgs from another repo..
PKGDIR=${ROOT}packages/
PORTAGE_TMPDIR=${ROOT}tmp/

ELIBC="__LIBC__"

PKG_CONFIG_PATH="${ROOT}usr/lib/pkgconfig/"
#PORTDIR_OVERLAY="/usr/portage/local/"
PORTDIR="/usr/portage"
DISTDIR="/usr/portage/distfiles"
PORTDIR_OVERLAY="/usr/local/portage/cross-i686-pc-mingw32 /usr/local/portage/layman/pro-audio /usr/local/portage/layman/java-overlay /usr/local/portage/layman/science /usr/local/portage/layman/kde-sunset /usr/local/portage/layman/mornifle-gentoo-package /usr/local/portage/layman/dev-zero /usr/local/portage/layman/dilfridge /usr/local/portage/layman/sunrise /usr/local/portage/layman/nx /usr/local/portage/layman/multimedia /usr/local/portage/layman/pythonhead /usr/local/portage/layman/ikelos /usr/local/portage/layman/godin /usr/local/portage/layman/ibormuth /usr/local/portage/layman/gamerlay /usr/local/portage/layman/seden /usr/local/portage/layman/sabayon /usr/local/portage/layman/sage-on-gentoo /usr/local/portage/layman/flora /usr/local/portage /usr/local/portage/mesEbuilds"
MAKEOPTS="-j9 --load-average=8"
GENTOO_MIRRORS="ftp://ftp.free.fr/mirrors/ftp.gentoo.org/ ftp://gentoo.imj.fr/pub/gentoo/ ftp://mirror.ovh.net/gentoo-distfiles/ http://gentoo.modulix.net/gentoo/ http://ftp.club-internet.fr/pub/mirrors/gentoo/ http://mirror.ovh.net/gentoo-distfiles/ http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo"


Any idea please ?
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21595

PostPosted: Thu Jul 11, 2013 9:18 pm    Post subject: Reply with quote

What is the output of ls -l /usr/i686-pc-mingw32/etc/make.profile?
Back to top
View user's profile Send private message
lalebarde
Guru
Guru


Joined: 03 Sep 2006
Posts: 464
Location: France, Haute-Garonne

PostPosted: Fri Jul 12, 2013 7:33 am    Post subject: Reply with quote

Here it is :
Code:
# ls -l /usr/i686-pc-mingw32/etc/make.profile
lrwxrwxrwx 1 root root 30 11 juil. 12:08 /usr/i686-pc-mingw32/etc/make.profile -> /usr/portage/profiles/embedded
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21595

PostPosted: Fri Jul 12, 2013 9:45 pm    Post subject: Reply with quote

What is the output of ls -l /usr/i686-pc-mingw32/usr/portage?
Back to top
View user's profile Send private message
lalebarde
Guru
Guru


Joined: 03 Sep 2006
Posts: 464
Location: France, Haute-Garonne

PostPosted: Mon Jul 15, 2013 10:01 am    Post subject: Reply with quote

undefined
Back to top
View user's profile Send private message
lalebarde
Guru
Guru


Joined: 03 Sep 2006
Posts: 464
Location: France, Haute-Garonne

PostPosted: Tue Jul 16, 2013 2:39 pm    Post subject: Reply with quote

I have added :
Code:
ln -s /usr/portage/profiles/embedded /usr/i686-pc-mingw32/etc/portage/make.profile
mkdir /usr/i686-pc-mingw32/usr/portage
/usr/i686-pc-mingw32/usr/portage/distfiles
i686-pc-mingw32-emerge --sync


But when I try to emerge something :
Code:
# i686-pc-mingw32-emerge app-portage/eix
!!! /usr/i686-pc-mingw32/etc/portage/make.profile is not a symlink and will probably prevent most merges.
!!! It should point into a profile within /usr/portage/profiles/
!!! (You can safely ignore this message when syncing. It's harmless.)

Calculating dependencies... done!
 * ARCH is not set... Are you missing the '/usr/i686-pc-
 * mingw32/etc/portage/make.profile' symlink? Is the symlink correct? Is
 * your portage tree complete?


I have defined the simlink as requested (cf 1st line). So ?
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21595

PostPosted: Tue Jul 16, 2013 9:59 pm    Post subject: Reply with quote

It looks like you synced into the wrong directory. However, there was no need for you to sync a second copy of the tree at all. In most cases, you want /usr/sysroot/usr/portage to link to /usr/portage.
Back to top
View user's profile Send private message
beatfinger
n00b
n00b


Joined: 07 Nov 2006
Posts: 13

PostPosted: Wed Jul 17, 2013 1:40 pm    Post subject: Reply with quote

I'm having a similar issue, but with arm. I set up a link from /usr/armv5te-softfloat-linux-gnueabi/usr/portage to /usr/portage, but I'm still getting the ARCH error.

Code:

jrsmith3@gentoo ~ $ ls -l /usr/armv5te-softfloat-linux-gnueabi/usr/
total 20
drwxr-xr-x  2 root root 4096 Jul 16 02:57 bin
drwxr-xr-x 31 root root 4096 Jul 16 02:57 include
drwxr-xr-x  5 root root 4096 Jul 16 02:57 lib
lrwxrwxrwx  1 root root   12 Jul 16 23:51 portage -> /usr/portage
drwxr-xr-x  2 root root 4096 Jul 16 02:57 sbin
drwxr-xr-x  5 root root 4096 Jul 16 02:57 share
jrsmith3@gentoo ~ $ ls -l /usr/armv5te-softfloat-linux-gnueabi/etc/
total 8
lrwxrwxrwx 1 root root   30 Jul 15 23:08 make.profile -> /usr/portage/profiles/embedded
drwxr-xr-x 2 root root 4096 Jul 16 23:05 portage
-rw-r--r-- 1 root root 1615 Jul 16 02:55 rpc
jrsmith3@gentoo ~ $ sudo armv5te-softfloat-linux-gnueabi-emerge tslib
Password:

 * IMPORTANT: 1 news items need reading for repository 'gentoo'.
 * Use eselect news to read news items.

Calculating dependencies... done!
 * ARCH is not set... Are you missing the '/usr/armv5te-softfloat-linux-
 * gnueabi/etc/portage/make.profile' symlink? Is the symlink correct? Is
 * your portage tree complete?
Back to top
View user's profile Send private message
lalebarde
Guru
Guru


Joined: 03 Sep 2006
Posts: 464
Location: France, Haute-Garonne

PostPosted: Thu Jul 18, 2013 11:05 am    Post subject: Reply with quote

@Hu : Thanks for the tip. I have deleted /usr/i686-pc-mingw32/usr/portage and made a link instead to /usr/portage.

For the rest, the problem remains the same :
Code:
# i686-pc-mingw32-emerge app-portage/eix
!!! /usr/i686-pc-mingw32/etc/portage/make.profile is not a symlink and will probably prevent most merges.
!!! It should point into a profile within /usr/portage/profiles/
!!! (You can safely ignore this message when syncing. It's harmless.)

Calculating dependencies... done!
 * ARCH is not set... Are you missing the '/usr/i686-pc-
 * mingw32/etc/portage/make.profile' symlink? Is the symlink correct? Is
 * your portage tree complete?
Back to top
View user's profile Send private message
univerz
n00b
n00b


Joined: 02 Nov 2005
Posts: 6
Location: Slovakia

PostPosted: Wed Sep 04, 2013 3:32 pm    Post subject: Reply with quote

same here. any good news?
Back to top
View user's profile Send private message
theism
n00b
n00b


Joined: 12 Sep 2013
Posts: 2
Location: Chernigov

PostPosted: Thu Sep 12, 2013 5:25 pm    Post subject: Reply with quote

One solution to:
I add to /usr/portage/profiles/embedded/make.defaults:
ARCH="x86"

But I'm not sure, maybe requires: x86-winnt
-------------- On russian ------------------
Одно из решений:
Я добавил в /usr/portage/profiles/embedded/make.defaults:
ARCH="x86"
Но не уверен, возможно корректней указать: x86-winnt
Установка пошла.
Back to top
View user's profile Send private message
jingwuyan218
n00b
n00b


Joined: 27 Jan 2014
Posts: 1

PostPosted: Mon Jan 27, 2014 1:34 pm    Post subject: Reply with quote

for armv7 :
ln -s /usr/portage/profile/arch/arm/armv7 /usr/arm-cortex-a8*/etc/make.profile .

试试看。like this
_________________
追求完美,必然艰辛
Back to top
View user's profile Send private message
zelurker
n00b
n00b


Joined: 10 Aug 2014
Posts: 23
Location: France

PostPosted: Wed Jan 07, 2015 9:11 am    Post subject: mingw32 Reply with quote

apparently for mingw32 replacing the make.profile symlink by :
ln -s /usr/portage/profiles/arch/x86 make.profile
in /usr/i686-pc-mingw32/etc/portage
fixed the problem for me...

EDIT : no it didn't, the compilations work, but in the end the link report undefined reference to winmain16, so I guess I broke the libs I rebuilt... !!!
I guess I'll fall back to good old manual compilation without emerge then... !
Back to top
View user's profile Send private message
melinux
n00b
n00b


Joined: 25 May 2006
Posts: 59
Location: Malta

PostPosted: Fri May 22, 2015 8:58 pm    Post subject: Reply with quote

Solved the same problem by editing
/usr/portage/profiles/embedded/make.defaults

and adding ARCH="x86"

(Crossdev for Mingw32)
Back to top
View user's profile Send private message
digifuzzy
Tux's lil' helper
Tux's lil' helper


Joined: 31 Oct 2014
Posts: 79

PostPosted: Wed Jul 08, 2015 9:03 pm    Post subject: Reply with quote

Modifying the /usr/portage/profiles/embedded/make.defaults file seems the incorrect approach.

I don't know enough about the emerge internals, but has anyone considered having a MinGW make.default?
Is it possible to create a mingw-based profile?
How can one tell crossdev and {x86_64-w64 | i686-pc}-mingw32 to use this profile?
Back to top
View user's profile Send private message
popham
n00b
n00b


Joined: 07 Jan 2016
Posts: 2

PostPosted: Thu Jan 07, 2016 7:34 pm    Post subject: Reply with quote

I bumbled across this thread while I was facing the same problem. Under the portage manpage, I finally noticed

Code:

make.defaults
...
    PROFILE_ONLY_VARIABLES = ARCH
        Prevent critical variables from being changed by the user in make.conf or the env.
...


So ARCH cannot be set under make.conf by design! Myself, I'm kinda annoyed that this broken thing was autogenerated for me.

The solution is to copy the profile's make.defaults to the profile override directory (typically /etc/portage/profile/, but I'm using crossdev so mine is /usr/armv7a-hardfloat-linux-gnueabihf/etc/portage/profile/). Now edit the overriding make.defaults to set ARCH.
Back to top
View user's profile Send private message
bazz
n00b
n00b


Joined: 18 Mar 2016
Posts: 2

PostPosted: Fri Mar 18, 2016 8:33 pm    Post subject: Reply with quote

popham wrote:
I bumbled across this thread while I was facing the same problem. Under the portage manpage, I finally noticed

Code:

make.defaults
...
    PROFILE_ONLY_VARIABLES = ARCH
        Prevent critical variables from being changed by the user in make.conf or the env.
...


So ARCH cannot be set under make.conf by design! Myself, I'm kinda annoyed that this broken thing was autogenerated for me.

The solution is to copy the profile's make.defaults to the profile override directory (typically /etc/portage/profile/, but I'm using crossdev so mine is /usr/armv7a-hardfloat-linux-gnueabihf/etc/portage/profile/). Now edit the overriding make.defaults to set ARCH.


I found a potentially simpler solution, by just removing "ARCH" from PROFILE_ONLY_VARIABLES in the /usr/xxxx/etc/portage/make.profile/make.defaults. I say potentially because I'm not sure if this a good strategy.
_________________
Do you feel lucky, punk?

Well do ya?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum