# gcc ports update



## drhowarddrfine (Mar 11, 2014)

I tried updating GCC in ports and I saw a warning that I should probably hit Control-C *be*cause GCC was trying to create older versions in the same directory as other versions of GCC. I spent some time looking around to see if this is talked about elsewhere but don't find anything. 

I started updating Firefox and now I'm going to bed so does anyone have any information about this?

```
===>>> gcc-4.6.4 1/3

===>  Cleaning for gcc-4.7.3
===>>> Waiting on fetch & checksum for lang/gcc <<<===

===>  gcc-4.7.3 conflicts with installed package(s): 
      gcc47-4.7.4.20140222

      They install files into the same place.
      You may want to stop build with Ctrl + C.
===>  License GPLv3 GPLv3RLE accepted by the user
===>  Found saved configuration for gcc-4.6.3_1
===>   gcc-4.7.3 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by gcc-4.7.3 for building


Making GCC 4.7.3 for x86_64-portbld-freebsd9.2 [c,c++,objc,fortran,java]

===>  gcc-4.7.3 conflicts with installed package(s): 
      gcc47-4.7.4.20140222

      They install files into the same place.
      You may want to stop build with Ctrl + C.
```


----------



## SirDice (Mar 11, 2014)

Which of the GCC ports are you trying to build?


----------



## drhowarddrfine (Mar 11, 2014)

portmaster says there is a new version of gcc-4.7.3 so I run `portmaster gcc`

```
===>>> The following actions will be taken if you choose to proceed:
	Upgrade gcc-4.6.4 to gcc-4.7.3
	Re-install gcc-ecj-4.5
	Re-install gcc47-4.7.4.20140222
	Re-install gccmakedep-1.0.2_1

===>>> Proceed? y/n [y] 


===>>> Starting build for multiple ports <<<===


===>>> gcc-4.6.4 1/3

===>>> Currently installed version: gcc-4.6.4
===>>> Port directory: /usr/ports/lang/gcc

===>>> Starting check for build dependencies
===>>> Gathering dependency list for lang/gcc from ports
===>>> Launching child to reinstall gcc-ecj-4.5

===>>> gcc-4.6.4 1/3 >> gcc-ecj-4.5 (1/1)

===>>> Currently installed version: gcc-ecj-4.5
===>>> Port directory: /usr/ports/lang/gcc-ecj45

===>>> Starting check for build dependencies
===>>> Gathering dependency list for lang/gcc-ecj45 from ports
===>>> Dependency check complete for lang/gcc-ecj45

===>>> gcc-4.6.4 1/3 >> gcc-ecj-4.5 (1/1)

===>  Cleaning for gcc-ecj-4.5
===>   gcc-ecj-4.5 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by gcc-ecj-4.5 for building
===>  Extracting for gcc-ecj-4.5
=> SHA256 Checksum OK for ecj-4.5.jar.
===>  Patching for gcc-ecj-4.5
===>  Configuring for gcc-ecj-4.5

===>>> Creating a backup package for old version gcc-ecj-4.5
Creating package for gcc-ecj-4.5
pkg: You are trying to delete package(s) which has dependencies that are still required:
lang/gcc-ecj45: lang/gcc, lang/gcc47
... delete these packages anyway in forced mode
Deinstallation has been requested for the following 1 packages:

	gcc-ecj-4.5

The deinstallation will free 1 MB
[1/1] Deleting gcc-ecj-4.5...
gcc-ecj-4.5 is required by: gcc-4.6.4 gcc47-4.7.4.20140222, deleting anyway
 done

===>>> Starting check for runtime dependencies
===>>> Gathering dependency list for lang/gcc-ecj45 from ports
===>>> No dependencies for lang/gcc-ecj45

===>  Staging for gcc-ecj-4.5
===>   Generating temporary packing list
install  -o root -g wheel -m 444 /usr/ports/distfiles//ecj-4.5.jar /usr/ports/lang/gcc-ecj45/work/stage/usr/local/share/java
====> Compressing man pages (compress-man)
===>  Installing for gcc-ecj-4.5
===>  Checking if lang/gcc-ecj45 already installed
===>   Registering installation for gcc-ecj-4.5
Installing gcc-ecj-4.5... done

===>>> Re-installation of gcc-ecj-4.5 succeeded


===>>> Returning to dependency check for lang/gcc
===>>> Dependency check complete for lang/gcc

===>>> gcc-4.6.4 1/3

===>  Cleaning for gcc-4.7.3
===>>> Waiting on fetch & checksum for lang/gcc <<<===

===>  gcc-4.7.3 conflicts with installed package(s): 
      gcc47-4.7.4.20140222

      They install files into the same place.
      You may want to stop build with Ctrl + C.
===>  License GPLv3 GPLv3RLE accepted by the user
===>  Found saved configuration for gcc-4.6.3_1
===>   gcc-4.7.3 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by gcc-4.7.3 for building


Making GCC 4.7.3 for x86_64-portbld-freebsd9.2 [c,c++,objc,fortran,java]

===>  gcc-4.7.3 conflicts with installed package(s): 
      gcc47-4.7.4.20140222

      They install files into the same place.
      You may want to stop build with Ctrl + C.
^C===>  License GPLv3 GPLv3RLE accepted by the user
===>  Found saved configuration for gcc-4.6.3_1
===>   gcc-4.7.3 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by gcc-4.7.3 for building

===>  gcc-4.7.3 conflicts with installed package(s): 
      gcc47-4.7.4.20140222

      They will not build together.
      Please remove them first with pkg delete.
*** [check-build-conflicts] Error code 1

Stop in /usr/ports/lang/gcc.
*** [build] Error code 1

Stop in /usr/ports/lang/gcc.

===>>> make failed for lang/gcc
===>>> Aborting update

===>>> Update for gcc-4.6.4 failed
===>>> Aborting update
```


----------



## SirDice (Mar 11, 2014)

Well, that's odd. lang/gcc is 4.7.3 whereas lang/gcc47 has 4.7.4. I think you should just remove lang/gcc and stick to lang/gcc47.


----------



## drhowarddrfine (Mar 11, 2014)

Here are the dependencies listed:

```
===>>> Warning: Ports with dependencies on gcc-4.6.4:
	gcc47-4.7.4.20140222
	rxvt-unicode-9.19_1
	chromium-33.0.1750.146_1
```


----------



## SirDice (Mar 11, 2014)

In that case the other way around may be better. What's depending on lang/gcc47?


----------



## drhowarddrfine (Mar 11, 2014)

This is interesting:

```
$ portmaster -e gcc47
===>>> Warning: Ports with dependencies on gcc47-4.7.4.20140222:
	rxvt-unicode-9.19_1
	chromium-33.0.1750.146_1
```


----------



## mix_room (Mar 11, 2014)

I am seeing the same thing when installing with pkg. For some odd reason Chromium has GCC as a install-dependency.

The list of ports which depend on lang/gcc is very long, seems as though something is off. http://www.freshports.org/lang/gcc lists 855 ports which require GCC to run.


----------



## kpa (Mar 11, 2014)

mix_room said:
			
		

> I am seeing the same thing when installing with pkg. For some odd reason chromium has gcc as a install-dependency.
> 
> The list of ports which depend on lang/gcc is very long, seems as though something is off. http://www.freshports.org/lang/gcc lists 855 ports which require gcc to run.



It's because the ports need the GCC runtime libraries to run (C++ libraries mostly) and right now there are no separate packages for those runtime libraries, only the compiler packages with everything included.


----------



## drhowarddrfine (Mar 11, 2014)

So should I just let the ports go ahead and build?


----------



## SirDice (Mar 11, 2014)

It will probably build it but it's not able to install it because it has conflicting files. I'm just guessing right now but I'd probably force removal of gcc47 and then set the origin of it to gcc: `pkg set -o lang/gcc47:lang/gcc`. After that you may want to rebuild those two ports that depended on gcc47.

I'm not sure if that's going to solve anything though, it may even break things. So definitely backup /var/db/pkg/local.sqlite.


----------



## drhowarddrfine (Mar 11, 2014)

`pkg info gcc` says this, though:


> GCC, the GNU Compiler Collection, supports a number of languages.  This
> port installs the C, C++, Fortran and Java front ends as gcc46, g++46,
> gfortran46, and gcj46, respectively.
> 
> ...


----------



## SirDice (Mar 11, 2014)

`pkg info` shows the information of your currently installed gcc. The port recently got updated from 4.6.4 to 4.7.3: http://svnweb.freebsd.org/ports/head/la ... e?view=log

I think I understand why there's a lang/gcc port but I'm a little worried about the differences in minor version numbers of the other ports like lang/gcc47. Perhaps it would be better if the gcc port is a slave port that builds lang/gcc47 (or any of the other versions).


----------



## larryvc (Mar 12, 2014)

I got the same warning for gcc-4.7.3 as in @drhowarddrfine's initial post when trying to `portmaster virtualbox-ose-additions` after a  pkgng install of virtualbox-ose-additions.  Odd that it wants to upgrade to that version.

For continuity of the thread, see my post https://forums.freebsd.org/viewtopic.php?p=253679#p253679 for why I tried to do the build after a package install.


----------



## AlVal (Mar 20, 2014)

Same problem for me, not sure how I ended up with both gcc and gcc47 to begin with, whether that's even advisable, or what other package led to me having both?


```
===>>> The following actions will be taken if you choose to proceed:
        Upgrade gcc-4.6.4 to gcc-4.7.3
        Upgrade gcc47-4.7.4.20140222 to gcc47-4.7.4.20140315

===>>> Returning to update check of installed ports

===>>> Launching child to install lang/gcc

===>>> All >> lang/gcc (3/13)

===>>> Currently installed version: gcc-4.6.4
===>>> Port directory: /usr/ports/lang/gcc

===>>> Starting check for build dependencies
===>>> Gathering dependency list for lang/gcc from ports
===>>> Dependency check complete for lang/gcc

===>>> All >> gcc-4.6.4 (3/13)

===>  Cleaning for gcc-4.7.3
Making GCC 4.7.3 for x86_64-portbld-freebsd9.1 [c,c++,objc,fortran,java]

===>  gcc-4.7.3 conflicts with installed package(s):
      gcc47-4.7.4.20140222

      They install files into the same place.
      You may want to stop build with Ctrl + C.
===>  License GPLv3 GPLv3RLE accepted by the user
===>  Found saved configuration for gcc-4.6.3
===>   gcc-4.7.3 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by gcc-4.7.3 for building

===>  gcc-4.7.3 conflicts with installed package(s):
      gcc47-4.7.4.20140222

      They will not build together.
      Please remove them first with pkg delete.
*** [check-build-conflicts] Error code 1

Stop in /usr/ports/lang/gcc.
*** [build] Error code 1

Stop in /usr/ports/lang/gcc.

===>>> make failed for lang/gcc
===>>> Aborting update

===>>> Update for lang/gcc failed
===>>> Aborting update

===>>> Killing background jobs
Terminated
===>>> There are messages from installed ports to display,
       but first take a moment to review the error messages
       above.  Then press Enter when ready to proceed.
```


----------



## ta0kira (Apr 3, 2014)

SirDice said:
			
		

> It will probably build it but it's not able to install it because it has conflicting files. I'm just guessing right now but I'd probably force removal of gcc47 and then set the origin of it to gcc: `pkg set -o lang/gcc47:lang/gcc`. After that you may want to rebuild those two ports that depended on gcc47.
> 
> I'm not sure if that's going to solve anything though, it may even break things. So definitely backup /var/db/pkg/local.sqlite.


I solved a few problems with this sort of approach, although I had to manually edit the database with `pkg shell`, because at least one package I have installed lists _both_ lang/gcc and lang/gcc47 as dependencies, which results in a uniqueness violation. There are a few suggestions for how to fix this on the web, but at least one of them I saw is somewhat dangerous; therefore, you need a little SQL knowledge to make sure it's done correctly. I also had to change `py27-setuptools` to `py27-setuptools27` for packages requiring the former that were installed via ports, which I _don't_ think can be done via `pkg set`.

Assuming you get the local database reconciled properly, you also need to run `pkg update` to make sure `pkg upgrade` doesn't complain about something missing when you run it later on.

Kevin Barry


----------



## SirDice (Apr 3, 2014)

ta0kira said:
			
		

> I also had to change `py27-setuptools` to `py27-setuptools27` for packages requiring the former that were installed via ports, which I _don't_ think can be done via `pkg set`.


That issue I think is this one:

```
20140307:
  AFFECTS: users of devel/py-setuptools dependent ports
  AUTHOR: sunpoet@FreeBSD.org

  devel/py-setuptools is being used for every python ports (if USE_PYDISTUTILS
  defined) since r336553. Due to PKGORIGIN limitation, we cannot build one
  python port with python27 and the other with python33 since they require
  different setuptools versions which have same PKGORIGIN. With the addition
  of py-setuptools{27,32,33}, we could now have py27-foo and py33-bar coexist
  in one system.

  Note that this is only a short-term solution. It does not help if you need
  coexistence of one port with different python versions, e.g. py27-foo and
  py33-foo.

  Please rebuild all ports that depend on devel/py-setuptools and use
  devel/py-setuptools{27,32,33} instead.

  XX represents python version (27, 32 or 33) in the following steps.

  pkgng users:

  # pkg set -o devel/py-setuptools:devel/py-setuptoolsXX

  portmaster users:

  # portmaster -o devel/py-setuptoolsXX devel/py-setuptools
  # portmaster -r py\*setuptools

  portupgrade users:

  # portupgrade -o devel/py-setuptoolsXX -f devel/py-setuptools
  # portupgrade -fr devel/py-setuptools
```


----------

