malloc.h:3:2: error: #error "<malloc.h> has been replaced by <stdlib.h>" Reproducible: Always Steps to Reproduce: 1.emerge -1av =media-libs/openjpeg-1.3 2. 3. Actual Results: >>> Unpacking source... >>> Unpacking openjpeg_v1_3.tar.gz to /var/tmp/portage/media-libs/openjpeg-1.3/work [32;01m*[0m Applying openjpeg-1.2-Makefile.patch ... [A[132C [34;01m[ [32;01mok[34;01m ][0m >>> Source unpacked. >>> Compiling source in /var/tmp/portage/media-libs/openjpeg-1.3/work/OpenJPEG_v1_3 ... gmake -j1 CC=i686-gentoo-freebsd6.2-gcc AR=i686-gentoo-freebsd6.2-ar 'COMPILERFLAGS=-O2 -mtune=i686 -pipe -std=c99 -fPIC' i686-gentoo-freebsd6.2-gcc -O2 -mtune=i686 -pipe -std=c99 -fPIC -Ilibopenjpeg -c libopenjpeg/bio.c -o libopenjpeg/bio.o In file included from libopenjpeg/opj_malloc.h:80, from libopenjpeg/opj_includes.h:104, from libopenjpeg/bio.c:32: /usr/include/malloc.h:3:2: error: #error "<malloc.h> has been replaced by <stdlib.h>" gmake: *** [libopenjpeg/bio.o] Error 1 [31;01m*[0m [31;01m*[0m ERROR: media-libs/openjpeg-1.3 failed. [31;01m*[0m Call stack: [31;01m*[0m ebuild.sh, line 49: Called src_compile [31;01m*[0m environment, line 2036: Called die [31;01m*[0m The specific snippet of code: [31;01m*[0m emake CC="$(tc-getCC)" AR="$(tc-getAR)" COMPILERFLAGS="${CFLAGS} -std=c99 -fPIC" || die "emake failed"; [31;01m*[0m The die message: [31;01m*[0m emake failed [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 '/var/log/portage/media-libs:openjpeg-1.3:20081229-165218.log'. [31;01m*[0m The ebuild environment file is located at '/var/tmp/portage/media-libs/openjpeg-1.3/temp/environment'. [31;01m*[0m Expected Results: compile and install
Created attachment 178489 [details, diff] openjpeg-1.3-malloc.patch here is the patch, please commit
Created attachment 178490 [details] ebuild to apply the patch
freebsd folks apply this themselves, but it looks like that patch contains garbage to me (empty typo-ed #if): http://www.freebsd.org/cgi/cvsweb.cgi/ports/graphics/openjpeg/files/patch-opj_malloc.h?rev=1.1
I modified FreeBSD's patch a bit, as I need it for FreeBSD 7.1 with Gentoo Prefix as well. Committed now in gentoo-x86, thanks!