WITH_GCC [Was: graphics/png does not build with lang/gcc]
on 26/04/2012 11:55 Andriy Gapon said the following: on 07/03/2012 18:19 Andriy Gapon said the following: on 07/03/2012 14:11 b. f. said the following: you can just install lang/gcc or lang/gcc46 and set USE_GCC=4.6 in your build environment, an included Makefile, or on the command line And an additional problem with this recommendation is that if a port has e.g. USE_GCC=4.2+ in its Makefile, then the user setting gets overridden (at least if it's in make.conf). So a better way to ask for gcc46+ is needed. BTW, our traditional taxonomy seems to be: USE_XXX is for stuff that ports really require, WITH_XXX is for user preferences. So it might make sense to create a WITH_GCC knob specifically for the use that you suggested above. My makefile-fu and ports-infrastructure-fu are really weak (maybe non-existent even), but here is my attempt: [see the attachment]. The idea behind the patch: - if WITH_GCC is not defined, then everything should be as before - if WITH_GCC is defined, but USE_GCC is not defined, then USE_GCC gets set from WITH_GCC - if both are defined o if USE_GCC is a concrete version, then it wins o else (if USE_GCC has the X+) form, then the minimum requested version becomes MAX(X, Y), where Y is from WITH_GCC [*] [*] Note that whether WITH_GCC has Y or Y+ form doesn't matter in this case. In all cases WITH_GCC can be used only to increase minimum required GCC version, unless a port wants a concrete fixed version. -- Andriy Gapon --- Mk/bsd.port.mk.orig 2012-05-06 12:14:36.049668562 +0300 +++ Mk/bsd.port.mk 2012-05-06 11:56:45.909668044 +0300 @@ -1678,7 +1678,7 @@ CONFIGURE_ENV+=MAKE=${GMAKE} .endif -.if defined(USE_GCC) || defined(USE_FORTRAN) +.if defined(USE_GCC) || defined(USE_FORTRAN) || defined(WITH_GCC) .include ${PORTSDIR}/Mk/bsd.gcc.mk .endif --- Mk/bsd.gcc.mk.orig 2012-05-06 11:12:55.628670003 +0300 +++ Mk/bsd.gcc.mk 2012-05-06 11:37:29.394675881 +0300 @@ -98,6 +98,30 @@ CONFIGURE_ENV+= F77=${F77} FC=${FC} MAKE_ENV+= F77=${F77} FC=${FC} FFLAGS=${FFLAGS} .endif +.if defined(WITH_GCC) + +# See if we can use a later version or exclusively the one specified. +_WITH_GCC:=${WITH_GCC:S/+//} + +# Check if WITH_GCC points to a valid version. +.for v in ${GCCVERSIONS} +. for j in ${GCCVERSION_${v}} +. if ${_WITH_GCC}==${j} +_WITH_GCCVERSION_OKAY= true; +. endif +. endfor +.endfor + +.if !defined(_WITH_GCCVERSION_OKAY) +IGNORE=Unknown version of GCC specified (WITH_GCC=${WITH_GCC}) +.endif + +.endif # WITH_GCC + +.if !defined(USE_GCC) +USE_GCC= ${WITH_GCC} +.undef _WITH_GCC +.endif .if defined(USE_GCC) @@ -143,6 +167,11 @@ IGNORE=Couldn't find your current GCCV # get the first available version. # .if defined(_GCC_ORLATER) +. if defined(_WITH_GCC) +. if ${_USE_GCC} ${_WITH_GCC} +_USE_GCC:= ${_WITH_GCC} +. endif +. endif . for v in ${GCCVERSIONS} . if ${_USE_GCC} == ${_GCCVERSION_${v}_V} _GCC_MIN1:=true ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: graphics/png does not build with lang/gcc
on 07/03/2012 18:19 Andriy Gapon said the following: on 07/03/2012 14:11 b. f. said the following: you can just install lang/gcc or lang/gcc46 and set USE_GCC=4.6 in your build environment, an included Makefile, or on the command line And an additional problem with this recommendation is that if a port has e.g. USE_GCC=4.2+ in its Makefile, then the user setting gets overridden (at least if it's in make.conf). So a better way to ask for gcc46+ is needed. BTW, our traditional taxonomy seems to be: USE_XXX is for stuff that ports really require, WITH_XXX is for user preferences. So it might make sense to create a WITH_GCC knob specifically for the use that you suggested above. -- Andriy Gapon ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: graphics/png does not build with lang/gcc
sorry, missed the list. On Thu, Mar 8, 2012 at 3:39 PM, Gautam l...@execve.net wrote: Hi, On Wed, Mar 7, 2012 at 5:41 PM, b. f. bf1...@googlemail.com wrote: On Mon, Feb 27, 2012 at 9:51 PM, Gautam list at execve.net wrote: Should I file a PR for this? There are some unresolved problems with stack protection, but you should not have to encounter them when building this port. The custom gcc article that you are attempting to use was written at a time when some of the related port Makefiles had some shortcomings that no longer exist, and is not the recommended way to use lang/gcc* for ports. For all but a handful of ports that lang/gcc* depends upon, or those that don't respect the toolchain-related variables, you can just install lang/gcc or lang/gcc46 and set USE_GCC=4.6 in your build environment, an included Makefile, or on the command line. I have been building graphics/png in this way for years. You can and should dispense with the libmap.conf additions, the hardcoded CC, CXX, and CPP in make.conf, etc. Thanks for your comments. I now tried this on the fresh 9.0-REL system I created, -- I cleared out make.conf, deleted libmap.conf. The problem still exists. Any pointers? Here is the log: uname -a FreeBSD vmboX 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan 3 07:15:25 UTC 2012 r...@obrian.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 vmboX# pkg_version -0v [K [Kv binutils-2.22 needs updating (port has 2.22_1) gcc-4.6.2 needs updating (port has 4.6.2_1) gmp-5.0.2 needs updating (port has 5.0.3) libiconv-1.13.1_1 = up-to-date with port mpc-0.9 = up-to-date with port mpfr-3.1.0_2= up-to-date with port vmboX# cd /etc vmboX# cat /etc/make.conf vmboX# cat /etc/liba [Kmap.conf cat: /etc/libmap.conf: No such file or directory vmboX# cd /usr/ports/graphics/png vmboX# make clean === Cleaning for png-1.4.8_1 vmboX# env USE_GCC=4.6 make === Vulnerability check disabled, database not found === License check disabled, port has not defined LICENSE === Found saved configuration for png-1.4.8_1 === Extracting for png-1.4.8_1 = SHA256 Checksum OK for libpng-1.4.8.tar.xz. = SHA256 Checksum OK for libpng-1.4.8-apng.patch.gz. /bin/cp /usr/ports/distfiles//libpng-1.4.8-apng.patch.gz /usr/ports/graphics/png/work/libpng-1.4.8/ /usr/bin/gzip -nf -9 -d /usr/ports/graphics/png/work/libpng-1.4.8/libpng-1.4.8-apng.patch.gz === Patching for png-1.4.8_1 === Applying extra patch /usr/ports/graphics/png/work/libpng-1.4.8/libpng-1.4.8-apng.patch === Applying FreeBSD patches for png-1.4.8_1 === png-1.4.8_1 depends on executable: gcc46 - found === png-1.4.8_1 depends on file: /usr/local/bin/as - found === Configuring for png-1.4.8_1 === Building for png-1.4.8_1 ( cat scripts/libpng-config-head.in; echo prefix=\/usr/local\; echo libdir=\/usr/local/lib\; echo ccopts=\-O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing\; echo cppflags=\\; echo I_opts=\-I/usr/local/include/libpng\; echo L_opts=\-L/usr/local/lib\; echo libs=\-lpng -lz -lm\; echo ldopts=\-Wl,-rpath=/usr/local/lib/gcc46\; cat scripts/ libpng-config-body.in ) libpng-config chmod +x libpng-config gcc46 -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c png.c gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c png.c -o png.So gcc46 -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngset.c gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngset.c -o pngset.So gcc46 -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngget.c gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngget.c -o pngget.So gcc46 -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngrutil.c gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngrutil.c -o pngrutil.So gcc46 -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngtrans.c gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngtrans.c -o pngtrans.So gcc46 -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngwutil.c gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngwutil.c -o pngwutil.So gcc46 -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46
Re: graphics/png does not build with lang/gcc
Hi, On Thu, Mar 8, 2012 at 4:27 PM, b. f. bf1...@googlemail.com wrote: On 3/8/12, Gautam l...@execve.net wrote: gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngpread.c -o *** Error code 1 1 error *** Error code 1 Stop in /usr/ports/graphics/png. *** Error code 1 Stop in /usr/ports/graphics/png. vmboX# Are you adding -fstack-protector to your CFLAGS? b. I dont have any special CFLAGS variables -- empty make.conf, no libmap.conf file. Just using env USE_GCC=4.6 as I indicated in my previous email. -fstack-protector is being auto-added when I make graphics/png. So that is either coming from the port itself or something else. Thanks Gautam ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: graphics/png does not build with lang/gcc
On Thursday 08 March 2012 11:10:42 Gautam wrote: On Thu, Mar 8, 2012 at 3:39 PM, Gautam l...@execve.net wrote: On Wed, Mar 7, 2012 at 5:41 PM, b. f. bf1...@googlemail.com wrote: On Mon, Feb 27, 2012 at 9:51 PM, Gautam list at execve.net wrote: Should I file a PR for this? There are some unresolved problems with stack protection, but you should not have to encounter them when building this port. The custom gcc article that you are attempting to use was written at a time when some of the related port Makefiles had some shortcomings that no longer exist, and is not the recommended way to use lang/gcc* for ports. For all but a handful of ports that lang/gcc* depends upon, or those that don't respect the toolchain-related variables, you can just install lang/gcc or lang/gcc46 and set USE_GCC=4.6 in your build environment, an included Makefile, or on the command line. I have been building graphics/png in this way for years. You can and should dispense with the libmap.conf additions, the hardcoded CC, CXX, and CPP in make.conf, etc. Thanks for your comments. I now tried this on the fresh 9.0-REL system I created, -- I cleared out make.conf, deleted libmap.conf. The problem still exists. Any pointers? Here is the log: uname -a FreeBSD vmboX 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan 3 07:15:25 UTC 2012 r...@obrian.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 vmboX# pkg_version -0v [K [Kv binutils-2.22 needs updating (port has 2.22_1) gcc-4.6.2 needs updating (port has 4.6.2_1) gmp-5.0.2 needs updating (port has 5.0.3) libiconv-1.13.1_1 = up-to-date with port mpc-0.9 = up-to-date with port mpfr-3.1.0_2= up-to-date with port vmboX# cd /etc vmboX# cat /etc/make.conf vmboX# cat /etc/liba [Kmap.conf cat: /etc/libmap.conf: No such file or directory vmboX# cd /usr/ports/graphics/png vmboX# make clean === Cleaning for png-1.4.8_1 vmboX# env USE_GCC=4.6 make === Vulnerability check disabled, database not found === License check disabled, port has not defined LICENSE === Found saved configuration for png-1.4.8_1 === Extracting for png-1.4.8_1 = SHA256 Checksum OK for libpng-1.4.8.tar.xz. = SHA256 Checksum OK for libpng-1.4.8-apng.patch.gz. /bin/cp /usr/ports/distfiles//libpng-1.4.8-apng.patch.gz /usr/ports/graphics/png/work/libpng-1.4.8/ /usr/bin/gzip -nf -9 -d /usr/ports/graphics/png/work/libpng-1.4.8/libpng-1.4.8-apng.patch.gz === Patching for png-1.4.8_1 === Applying extra patch /usr/ports/graphics/png/work/libpng-1.4.8/libpng-1.4.8-apng.patch === Applying FreeBSD patches for png-1.4.8_1 === png-1.4.8_1 depends on executable: gcc46 - found === png-1.4.8_1 depends on file: /usr/local/bin/as - found === Configuring for png-1.4.8_1 === Building for png-1.4.8_1 ( cat scripts/libpng-config-head.in; echo prefix=\/usr/local\; echo libdir=\/usr/local/lib\; echo ccopts=\-O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing\; echo cppflags=\\; echo I_opts=\-I/usr/local/include/libpng\; echo L_opts=\-L/usr/local/lib\; echo libs=\-lpng -lz -lm\; echo ldopts=\-Wl,-rpath=/usr/local/lib/gcc46\; cat scripts/ libpng-config-body.in ) libpng-config chmod +x libpng-config gcc46 -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c png.c gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c png.c -o png.So gcc46 -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngset.c gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngset.c -o pngset.So gcc46 -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngget.c gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngget.c -o pngget.So gcc46 -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngrutil.c gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngrutil.c -o pngrutil.So gcc46 -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngtrans.c gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngtrans.c -o pngtrans.So gcc46 -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngwutil.c gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngwutil.c -o pngwutil.So gcc46 -O2 -pipe
Re: graphics/png does not build with lang/gcc
On 3/8/12, Tijl Coosemans t...@coosemans.org wrote: On Thursday 08 March 2012 11:10:42 Gautam wrote: On Thu, Mar 8, 2012 at 3:39 PM, Gautam l...@execve.net wrote: On Wed, Mar 7, 2012 at 5:41 PM, b. f. bf1...@googlemail.com wrote: On Mon, Feb 27, 2012 at 9:51 PM, Gautam list at execve.net wrote: Should I file a PR for this? There are some unresolved problems with stack protection, but you should not have to encounter them when building this port. The custom gcc article that you are attempting to use was written at a time when some of the related port Makefiles had some shortcomings that no longer exist, and is not the recommended way to use lang/gcc* for ports. For all but a handful of ports that lang/gcc* depends upon, or those that don't respect the toolchain-related variables, you can just install lang/gcc or lang/gcc46 and set USE_GCC=4.6 in your build environment, an included Makefile, or on the command line. I have been building graphics/png in this way for years. You can and should dispense with the libmap.conf additions, the hardcoded CC, CXX, and CPP in make.conf, etc. Thanks for your comments. I now tried this on the fresh 9.0-REL system I created, -- I cleared out make.conf, deleted libmap.conf. The problem still exists. Any pointers? Here is the log: uname -a FreeBSD vmboX 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan 3 07:15:25 UTC 2012 r...@obrian.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 vmboX# pkg_version -0v [K [Kv binutils-2.22 needs updating (port has 2.22_1) gcc-4.6.2 needs updating (port has 4.6.2_1) gmp-5.0.2 needs updating (port has 5.0.3) libiconv-1.13.1_1 = up-to-date with port mpc-0.9 = up-to-date with port mpfr-3.1.0_2= up-to-date with port vmboX# cd /etc vmboX# cat /etc/make.conf vmboX# cat /etc/liba [Kmap.conf cat: /etc/libmap.conf: No such file or directory vmboX# cd /usr/ports/graphics/png vmboX# make clean === Cleaning for png-1.4.8_1 vmboX# env USE_GCC=4.6 make === Vulnerability check disabled, database not found === License check disabled, port has not defined LICENSE === Found saved configuration for png-1.4.8_1 === Extracting for png-1.4.8_1 = SHA256 Checksum OK for libpng-1.4.8.tar.xz. = SHA256 Checksum OK for libpng-1.4.8-apng.patch.gz. /bin/cp /usr/ports/distfiles//libpng-1.4.8-apng.patch.gz /usr/ports/graphics/png/work/libpng-1.4.8/ /usr/bin/gzip -nf -9 -d /usr/ports/graphics/png/work/libpng-1.4.8/libpng-1.4.8-apng.patch.gz === Patching for png-1.4.8_1 === Applying extra patch /usr/ports/graphics/png/work/libpng-1.4.8/libpng-1.4.8-apng.patch === Applying FreeBSD patches for png-1.4.8_1 === png-1.4.8_1 depends on executable: gcc46 - found === png-1.4.8_1 depends on file: /usr/local/bin/as - found === Configuring for png-1.4.8_1 === Building for png-1.4.8_1 ( cat scripts/libpng-config-head.in; echo prefix=\/usr/local\; echo libdir=\/usr/local/lib\; echo ccopts=\-O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing\; echo cppflags=\\; echo I_opts=\-I/usr/local/include/libpng\; echo L_opts=\-L/usr/local/lib\; echo libs=\-lpng -lz -lm\; echo ldopts=\-Wl,-rpath=/usr/local/lib/gcc46\; cat scripts/ libpng-config-body.in ) libpng-config chmod +x libpng-config gcc46 -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c png.c gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c png.c -o png.So gcc46 -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngset.c gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngset.c -o pngset.So gcc46 -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngget.c gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngget.c -o pngget.So gcc46 -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngrutil.c gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngrutil.c -o pngrutil.So gcc46 -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngtrans.c gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngtrans.c -o pngtrans.So gcc46 -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c pngwutil.c gcc46 -fpic -DPIC -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc46 -fno-strict-aliasing -I. -std=gnu99 -fstack-protector -c
Re: graphics/png does not build with lang/gcc
Adding dinoex (Maintainer of graphics/png). On Mon, Feb 27, 2012 at 9:51 PM, Gautam list at execve.net wrote: Still didnt work for me -- did another buildworld and retried to check if there was something else messed up. I am moving back to base gcc for now. Waiting for redports lang/gcc backend to come up ;) and will check this again on 8-stable as well. I have tested this on three systems now -- 8.2-REL (fresh), 9.0-REL(fresh) and 9.0-STABLE (original system). The problem is visible on all of these releases. I have now root-caused this problem (that graphics/png does not build with lang/gcc on 8.2 or 9.0), proposed solution solves it on all three systems. Similar PRs were found: 155334 and 141238. Solution is to add -lssp_nonshared to LDADD in work/libpng-1.4.8/scripts/makefile.freebsd. LDADD+= -lm -lz -lssp_nonshared However, I suppose this be conditional on OSVERSION = 80 so that it doesnt break older FreeBSD releases but I am not sure of the final solution to this -- maybe add a conditional patch ? How is that usually done? Should I file a PR for this? There are some unresolved problems with stack protection, but you should not have to encounter them when building this port. The custom gcc article that you are attempting to use was written at a time when some of the related port Makefiles had some shortcomings that no longer exist, and is not the recommended way to use lang/gcc* for ports. For all but a handful of ports that lang/gcc* depends upon, or those that don't respect the toolchain-related variables, you can just install lang/gcc or lang/gcc46 and set USE_GCC=4.6 in your build environment, an included Makefile, or on the command line. I have been building graphics/png in this way for years. You can and should dispense with the libmap.conf additions, the hardcoded CC, CXX, and CPP in make.conf, etc. b. ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: graphics/png does not build with lang/gcc
on 07/03/2012 14:11 b. f. said the following: you can just install lang/gcc or lang/gcc46 and set USE_GCC=4.6 in your build environment, an included Makefile, or on the command line BTW, our traditional taxonomy seems to be: USE_XXX is for stuff that ports really require, WITH_XXX is for user preferences. So it might make sense to create a WITH_GCC knob specifically for the use that you suggested above. -- Andriy Gapon ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: graphics/png does not build with lang/gcc
On 3/7/12, Andriy Gapon a...@freebsd.org wrote: on 07/03/2012 14:11 b. f. said the following: you can just install lang/gcc or lang/gcc46 and set USE_GCC=4.6 in your build environment, an included Makefile, or on the command line BTW, our traditional taxonomy seems to be: USE_XXX is for stuff that ports really require, WITH_XXX is for user preferences. So it might make sense to create a WITH_GCC knob specifically for the use that you suggested above. Yes, that is a reasonable suggestion, not only for lang/gcc*, but also for a few other compilers. But I think that before such a user-configurable knob can be introduced, with an implied promise of support for it, several outstanding problems with the widespread use of such a knob need to be addressed -- for example, the (still) pending fixes to USE_BINUTILS, changes to the compiler configurations (to fix things like PIE and stack protection), changes to the use of libtool, and introduction of periodic checks to find and fix ports that don't respect the toolchain variables. b. ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: graphics/png does not build with lang/gcc
On Wed, Mar 07, 2012 at 06:19:51PM +0200, Andriy Gapon wrote: BTW, our traditional taxonomy seems to be: USE_XXX is for stuff that ports really require, WITH_XXX is for user preferences. This isn't a taxonomy suggestion, it's a documented requirement: http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/makefile-depend.html#USE-VARS This often trips up users. See the (Note). If there are lurking uses of WITH_ or WITHOUT_ in port Makefiles where USE_ is intended, they are bugs. mcl ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: graphics/png does not build with lang/gcc
On Wed, Mar 07, 2012 at 12:11:52PM +, b. f. wrote: The custom gcc article that you are attempting to use was written at a time when some of the related port Makefiles had some shortcomings that no longer exist, and is not the recommended way to use lang/gcc* for ports. Would you be interested in helping to update it? For all but a handful of ports that lang/gcc* depends upon, or those that don't respect the toolchain-related variables, you can just install lang/gcc or lang/gcc46 and set USE_GCC=4.6 in your build environment, an included Makefile, or on the command line. Setting USE_* in e.g. /etc/make.conf is always incorrect, see: http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/makefile-depend.html#USE-VARS You can wind up in the degenerate case maknig gcc46 depend upon itself. mcl ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: graphics/png does not build with lang/gcc
On 3/8/12, Mark Linimon lini...@lonesome.com wrote: On Wed, Mar 07, 2012 at 12:11:52PM +, b. f. wrote: The custom gcc article that you are attempting to use was written at a time when some of the related port Makefiles had some shortcomings that no longer exist, and is not the recommended way to use lang/gcc* for ports. Would you be interested in helping to update it? If you like, I can suggest a few changes. But I thought that it was primarily Martin's article, which he wrote when he was benchmarking perl with different toolchains. For all but a handful of ports that lang/gcc* depends upon, or those that don't respect the toolchain-related variables, you can just install lang/gcc or lang/gcc46 and set USE_GCC=4.6 in your build environment, an included Makefile, or on the command line. Setting USE_* in e.g. /etc/make.conf is always incorrect, see: http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/makefile-depend.html#USE-VARS You can wind up in the degenerate case maknig gcc46 depend upon itself. That is why I wrote: ... all but a handful of ports that lang/gcc* depends upon The OP wanted to find a way to use lang/gcc* in a custom build of a port -- which, as you know from your own work, isn't well-supported in Ports right now. (We make an attempt to be flexible, and there is some infrastructure to do so, but many ports aren't tested with different toolchains. Some tinkering is inevitably involved if any substantial number of ports are built in this way.) The OP was willing to use invasive changes suggested by the custom gcc article. Therefore, I assumed that he wasn't interested in strictly adhering to our guidelines, and just wanted a pragmatic solution, which is what I offered to him. Setting USE_GCC in this case is safer and easier than what he was doing. I didn't intend to suggest that anyone make unqualified use of it in make.conf. There is already far too much abuse of that special file. b. ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: graphics/png does not build with lang/gcc
Hi, Adding dinoex (Maintainer of graphics/png). On Mon, Feb 27, 2012 at 9:51 PM, Gautam l...@execve.net wrote: Still didnt work for me -- did another buildworld and retried to check if there was something else messed up. I am moving back to base gcc for now. Waiting for redports lang/gcc backend to come up ;) and will check this again on 8-stable as well. I have tested this on three systems now -- 8.2-REL (fresh), 9.0-REL(fresh) and 9.0-STABLE (original system). The problem is visible on all of these releases. I have now root-caused this problem (that graphics/png does not build with lang/gcc on 8.2 or 9.0), proposed solution solves it on all three systems. Similar PRs were found: 155334 and 141238. Solution is to add -lssp_nonshared to LDADD in work/libpng-1.4.8/scripts/makefile.freebsd. LDADD+= -lm -lz -lssp_nonshared However, I suppose this be conditional on OSVERSION = 80 so that it doesnt break older FreeBSD releases but I am not sure of the final solution to this -- maybe add a conditional patch ? How is that usually done? Should I file a PR for this? Thanks Gautam ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: graphics/png does not build with lang/gcc
Hi, On Sun, Feb 26, 2012 at 1:43 AM, Jakub Lach jakub_l...@mailplus.pl wrote: To be precise, I'm user of lang/gcc46, but since long before lang/gcc creation, so it shouldn't really matter. Still didnt work for me -- did another buildworld and retried to check if there was something else messed up. I am moving back to base gcc for now. Waiting for redports lang/gcc backend to come up ;) and will check this again on 8-stable as well. Thanks Gautam ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: graphics/png does not build with lang/gcc
Hi, On Wed, Feb 22, 2012 at 10:10 PM, Jakub Lach jakub_l...@mailplus.pl wrote: make.conf: .if !empty(.CURDIR:M/usr/ports/*) WRKDIRPREFIX= /usr/obj .include /etc/ports.conf .endif ports.conf: CC=gcc46 CXX=g++46 CFLAGS=-O2 -pipe -march=native CXXFLAGS=${CFLAGS} No such problem here. Thanks for the response. I am still seeing this problem. Do you have something specific in libmap.conf or some other configuration relating to LD/LDFLAGS? -Gautam ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: graphics/png does not build with lang/gcc
I don't think so. Maybe it's P4 specific. -- View this message in context: http://freebsd.1045724.n5.nabble.com/graphics-png-does-not-build-with-lang-gcc-tp5495065p5515744.html Sent from the freebsd-ports mailing list archive at Nabble.com. ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: graphics/png does not build with lang/gcc
/etc/libmap.conf libgcc_s.so.1 gcc46/libgcc_s.so.1 libgomp.so.1gcc46/libgomp.so.1 libssp.so.0 gcc46/libssp.so.0 libstdc++.so.6 gcc46/libstdc++.so.6 -- View this message in context: http://freebsd.1045724.n5.nabble.com/graphics-png-does-not-build-with-lang-gcc-tp5495065p5515746.html Sent from the freebsd-ports mailing list archive at Nabble.com. ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: graphics/png does not build with lang/gcc
To be precise, I'm user of lang/gcc46, but since long before lang/gcc creation, so it shouldn't really matter. -- View this message in context: http://freebsd.1045724.n5.nabble.com/graphics-png-does-not-build-with-lang-gcc-tp5495065p5515762.html Sent from the freebsd-ports mailing list archive at Nabble.com. ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: graphics/png does not build with lang/gcc
make.conf: .if !empty(.CURDIR:M/usr/ports/*) WRKDIRPREFIX= /usr/obj .include /etc/ports.conf .endif ports.conf: CC=gcc46 CXX=g++46 CFLAGS=-O2 -pipe -march=native CXXFLAGS=${CFLAGS} No such problem here. -- View this message in context: http://freebsd.1045724.n5.nabble.com/graphics-png-does-not-build-with-lang-gcc-tp5495065p5505596.html Sent from the freebsd-ports mailing list archive at Nabble.com. ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: graphics/png does not build with lang/gcc
Hi, Reminder - any pointers on this one? Including Doug who had posted similar problem in 2010. On Sat, Feb 18, 2012 at 4:17 PM, Gautam l...@execve.net wrote: Hi, I am running GENERIC on FreeBSD 9.0-STABLE FreeBSD 9.0-STABLE #2: Mon Jan 30 04:18:20 IST 2012 with the tree csupped just before the build. I setup lang/gcc as per http://www.freebsd.org/doc/en/articles/custom-gcc/article.html added following to /etc/make.conf CC=gcc46 CXX=g++46 CPP=cpp46 and the following to /etc/libmap.config libgcc_s.so.1 gcc46/libgcc_s.so.1 libgomp.so.1gcc46/libgomp.so.1 libobjc.so.3gcc46/libobjc.so.2 libssp.so.0 gcc46/libssp.so.0 libstdc++.so.6 gcc46/libstdc++.so.6 When I tried to rebuild some ports, I found a problem with linking graphics/png. I found a similar problem mentioned in http://lists.freebsd.org/pipermail/freebsd-ports/2010-June/062166.html* *but no conclusion to the same. # idprio 31 make === License check disabled, port has not defined LICENSE === Found saved configuration for png-1.4.8 === Extracting for png-1.4.8 = SHA256 Checksum OK for libpng-1.4.8.tar.xz. = SHA256 Checksum OK for libpng-1.4.8-apng.patch.gz. . gcc46 -fpic -DPIC -O2 -pipe -march=pentium4 -fno-strict-aliasing -march=pentium4 -I. -std=gnu99 -fstack-protector -c pngpread.c -o pngpread.So gzip -cn libpng.3 libpng.3.gz gzip -cn libpngpf.3 libpngpf.3.gz gzip -cn png.5 png.5.gz gcc46 -O2 -pipe -march=pentium4 -fno-strict-aliasing -march=pentium4 -I. -std=gnu99 -fstack-protector -c pngtest.c building static png library building shared library libpng.so.6 ranlib libpng.a pngread.So: In function `png_create_read_struct_2': pngread.c:(.text+0x4e7): undefined reference to `__stack_chk_fail_local' pngrutil.So: In function `png_inflate': pngrutil.c:(.text+0x166): undefined reference to `__stack_chk_fail_local' pngrutil.So: In function `png_decompress_chunk': pngrutil.c:(.text+0x6e6): undefined reference to `__stack_chk_fail_local' pngrutil.So: In function `.L69': pngrutil.c:(.text+0x90f): undefined reference to `__stack_chk_fail_local' pngrutil.So: In function `png_handle_cHRM': pngrutil.c:(.text+0x1431): undefined reference to `__stack_chk_fail_local' pngrutil.So:pngrutil.c:(.text+0x19d9): more undefined references to `__stack_chk_fail_local' follow collect2: ld returned 1 exit status *** Error code 1 gcc46 -O2 -pipe -march=pentium4 -fno-strict-aliasing -march=pentium4 -I. -std=gnu99 -fstack-protector -L. -static -o pngtest pngtest.o -lpng -lz -lm 1 error *** Error code 1 Stop in /usr/ports/graphics/png. *** Error code 1 Stop in /usr/ports/graphics/png. --- I have seen different workarounds for this online for e.g, SSP_CFLAGS= in /etc/make.conf or patching /etc/rc.d/ldconfig to pick up /usr/local/lib/gcc46 first but somehow these do not seem clean enough. Or is it a straightforward port specific problem -- that needs to be fixed in graphics/png. I suspect that I am not alone in wanting to build ports with lang/gcc, so how are others avoiding this situation? Thanks in advance! Gautam ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
graphics/png does not build with lang/gcc
Hi, I am running GENERIC on FreeBSD 9.0-STABLE FreeBSD 9.0-STABLE #2: Mon Jan 30 04:18:20 IST 2012 with the tree csupped just before the build. I setup lang/gcc as per http://www.freebsd.org/doc/en/articles/custom-gcc/article.html added following to /etc/make.conf CC=gcc46 CXX=g++46 CPP=cpp46 and the following to /etc/libmap.config libgcc_s.so.1 gcc46/libgcc_s.so.1 libgomp.so.1gcc46/libgomp.so.1 libobjc.so.3gcc46/libobjc.so.2 libssp.so.0 gcc46/libssp.so.0 libstdc++.so.6 gcc46/libstdc++.so.6 When I tried to rebuild some ports, I found a problem with linking graphics/png. I found a similar problem mentioned in http://lists.freebsd.org/pipermail/freebsd-ports/2010-June/062166.html* *but no conclusion to the same. # idprio 31 make === License check disabled, port has not defined LICENSE === Found saved configuration for png-1.4.8 === Extracting for png-1.4.8 = SHA256 Checksum OK for libpng-1.4.8.tar.xz. = SHA256 Checksum OK for libpng-1.4.8-apng.patch.gz. . gcc46 -fpic -DPIC -O2 -pipe -march=pentium4 -fno-strict-aliasing -march=pentium4 -I. -std=gnu99 -fstack-protector -c pngpread.c -o pngpread.So gzip -cn libpng.3 libpng.3.gz gzip -cn libpngpf.3 libpngpf.3.gz gzip -cn png.5 png.5.gz gcc46 -O2 -pipe -march=pentium4 -fno-strict-aliasing -march=pentium4 -I. -std=gnu99 -fstack-protector -c pngtest.c building static png library building shared library libpng.so.6 ranlib libpng.a pngread.So: In function `png_create_read_struct_2': pngread.c:(.text+0x4e7): undefined reference to `__stack_chk_fail_local' pngrutil.So: In function `png_inflate': pngrutil.c:(.text+0x166): undefined reference to `__stack_chk_fail_local' pngrutil.So: In function `png_decompress_chunk': pngrutil.c:(.text+0x6e6): undefined reference to `__stack_chk_fail_local' pngrutil.So: In function `.L69': pngrutil.c:(.text+0x90f): undefined reference to `__stack_chk_fail_local' pngrutil.So: In function `png_handle_cHRM': pngrutil.c:(.text+0x1431): undefined reference to `__stack_chk_fail_local' pngrutil.So:pngrutil.c:(.text+0x19d9): more undefined references to `__stack_chk_fail_local' follow collect2: ld returned 1 exit status *** Error code 1 gcc46 -O2 -pipe -march=pentium4 -fno-strict-aliasing -march=pentium4 -I. -std=gnu99 -fstack-protector -L. -static -o pngtest pngtest.o -lpng -lz -lm 1 error *** Error code 1 Stop in /usr/ports/graphics/png. *** Error code 1 Stop in /usr/ports/graphics/png. --- Any pointers? Thanks, Gautam* * ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org