I have problem with compiling cpp that include another cpp files
so I have Main.cpp Numbers.h and Numbers.cpp and it seems that TextMate only compile my Main.cpp and doesn't include the rest. I tried using xcode and it was working fine..
Here is the error from TextMate cmd+R:
Undefined symbols:
"Numbers::Numbers(int)", referenced from:
_main in ccMrD1Eq.o
"Numbers::print()", referenced from:
_main in ccMrD1Eq.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Any suggestion?
Btw, here is the invoked command:
#!/usr/bin/env ruby
require ENV["TM_SUPPORT_PATH"] + "/lib/tm/executor"
require ENV["TM_SUPPORT_PATH"] + "/lib/tm/save_current_document"
mode = ENV["TM_SCOPE"].slice(/.*?\bsource\.((?:obj)?c(\+\+)?)/, 1)
case mode
when "c"
g = "GCC"
env = "C"
ext = "c"
lang = "c"
when "c++"
g = "GXX"
env = "CXX"
ext = "cc"
lang = "c++"
when "objc"
g = "GCC"
env = "OBJC"
ext = "m"
lang = "objective-c"
when "objc++"
g = "GXX"
env = "OBJCXX"
ext = "mm"
lang = "objective-c++"
end
TextMate.save_current_document(ext)
TextMate::Executor.make_project_master_current_document
flags = ENV["TM_#{env}_FLAGS"] || "-Wall -include stdio.h #{"-include iostream" unless mode[/c\+\+$/].nil?} #{"-framework Cocoa" unless mode[/^obj/].nil?}"
args = [ENV["TM_#{g}"] || g.downcase.gsub("x", "+"), flags + " -x #{lang}", ENV["TM_FILEPATH"]]
TextMate::Executor.run(args, :version_args => ["--version"], :version_regex => /\A([^\n]*) \(GCC\).*/m)
TextMate only does a simple compile of the .cpp file you're currently editing. Unlike Xcode or other full development environments it won't compile other source files in the project or perform linking.
(In TextMate click Bundles > Bundle Editor > Show Bundle Editor, then choose Run in the C section and you'll see exactly what TextMate is doing when you "Run" a .cpp file.)
You probably need to add additional command line parameters...
You can add additional command line parameters to g++ by altering the variable TM_CXX_FLAGS.
The best way to do this is probably to add a per project variable:
http://manual.macromates.com/en/environment_variables#project_dependent_variables
If the change is meant to be global you can add it to TextMate's static vars section
http://manual.macromates.com/en/environment_variables#static_variables
i don't have enough info to be certain of the command you're invoking.
if it's Xcode.tmbundle Build and Run, then it's invoking xcodebuild -- you should be able to reproduce and fix the error in Xcode.
Related
GCC allows querying available warning flags specific for C++ language with the syntax:
g++ -Q --help=warning,c++
Adding warning flags to the call includes them in the result:
g++ -Wall -Q --help=warning,c++
However, it seems the call is done from the C point of view and I don't know how to do it from the C++ point of view. If the call includes C++-only warning, like:
g++ -Wnon-virtual-dtor -Q --help=warning,c++
the output contains a message:
cc1: warning: command line option ‘-Wnon-virtual-dtor’ is valid for C++/ObjC++ but not for C
and still shows the warning as disabled:
-Wnon-virtual-dtor [disabled]
Note, that this happens regardless of whether the call is done using g++ or gcc.
The same with C-only -Wbad-function-cast behaves in an expected way:
gcc -Wbad-function-cast -Q --help=warning,c
There is no extra message and reported warning status changes between [disabled] and [enabled]. Again, regardless of whether g++ or gcc is used.
I'm using GCC version 7.3.0. Although the issue seems to apply to many if not all versions. It can be observed through Compiler Explorer.
So, is there a way to do this query with respect to given language?
Yes, your observations are correct.
Probably this is not the intended behavior, and if you care about this feature, then I suggest reporting it upstream.
Note that this works, however:
touch 1.cc
g++ -Wnon-virtual-dtor -Q --help=warning,c++ 1.cc
I.e. if there's an input file with a proper extension, then the correct compiler proper executable is invoked: cc1plus, not cc1. The latter is the default if no input files are present. I did some quick debugging, and here's how that happens:
// gcc.c:
driver::do_spec_on_infiles () const
{
...
for (i = 0; (int) i < n_infiles; i++)
{
...
/* Figure out which compiler from the file's suffix. */
input_file_compiler
= lookup_compiler (infiles[i].name, input_filename_length,
infiles[i].language);
if (input_file_compiler)
{
...
value = do_spec (input_file_compiler->spec);
And input_file_compiler at that point is the C compiler, because
p n_infiles
$9 = 1
(gdb) p infiles[0]
$10 = {name = 0x4cbfb0 "help-dummy", language = 0x4cbfae "c", incompiler = 0x58a920, compiled = false, preprocessed = false}
Here's how the dummy file got created (function process_command in the same file):
if (n_infiles == 0
&& (print_subprocess_help || print_help_list || print_version))
{
/* Create a dummy input file, so that we can pass
the help option on to the various sub-processes. */
add_infile ("help-dummy", "c");
}
I am attempting to build the gitlib-libgit2 Haskell package on macos via nix in roughly the following manner.
mkdir nix-repro && cd nix-repro
cabal2nix --no-check cabal://gitlib-libgit2 > gitlib-libgit2.nix
echo '(import <nixpkgs> {}).haskellPackages.callPackage ./gitlib-libgit2.nix {}' > default.nix
nix-build
I am seeing the following warnings and error:
ld: warning: /nix/store/spx9xz1jv3yhmqw8y3agki1fvdr2x2fv-libiconv-osx-10.11.6/lib/libiconv.dylib, ignoring unexpected dylib file
ld: warning: /nix/store/spx9xz1jv3yhmqw8y3agki1fvdr2x2fv-libiconv-osx-10.11.6/lib/libiconv.dylib, ignoring unexpected dylib file
/nix/store/s33984hx2gwcg2d4dgpcm4342md19qvh-cctools-binutils-darwin/bin/ranlib: object: dist/build/libHSgitlib-libgit2-3.1.2.1-1fYQZMedHRP3aXiBXJFDO2-ghc8.6.3.a(s2_meth.o) malformed object (unknown load command 1)
`ranlib' failed in phase `Ranlib'. (Exit code: 1)
builder for '/nix/store/yrran1p69pvdq1b34jqfq7dmd95j9fh9-gitlib-libgit2-3.1.2.1.drv' failed with exit code 1
error: build of '/nix/store/yrran1p69pvdq1b34jqfq7dmd95j9fh9-gitlib-libgit2-3.1.2.1.drv' failed
What does this mean, and how can I go about fixing it?
It only fails this way on macos, as far as I can tell. I'm on nixpkgs-unstable. I am able to build this package using other tools, so the failure must be something specific to the nix tooling I'm using to build it.
$ cat $HOME/.nix-defexpr/channels/nixpkgs/.git-revision
6e5caa3f8ac48750233ef82a94825be238940825
Here's the full gitlib-libgit2.nix expression if you don't want to run cabal2nix for yourself:
{ mkDerivation, base, bytestring, conduit, conduit-combinators
, containers, directory, exceptions, fast-logger, filepath, gitlib
, gitlib-test, hlibgit2, hspec, hspec-expectations, HUnit, mmorph
, monad-loops, mtl, resourcet, stdenv, stm, stm-conduit, tagged
, template-haskell, text, text-icu, time, transformers
, transformers-base, unliftio, unliftio-core
}:
mkDerivation {
pname = "gitlib-libgit2";
version = "3.1.2.1";
sha256 = "b90e0ad2e7e0f58379e02cbe60d2900c95f0a255c34bd3461f8ee5753a6aa23e";
libraryHaskellDepends = [
base bytestring conduit conduit-combinators containers directory
exceptions fast-logger filepath gitlib hlibgit2 mmorph monad-loops
mtl resourcet stm stm-conduit tagged template-haskell text text-icu
time transformers transformers-base unliftio unliftio-core
];
testHaskellDepends = [
base exceptions gitlib gitlib-test hspec hspec-expectations HUnit
transformers
];
doCheck = false;
description = "Libgit2 backend for gitlib";
license = stdenv.lib.licenses.mit;
}
I am using Eigen(3.2.0) Library under Workbench3.0 (vxworks 6.6). The compiler in this distribution is GCC version 4.1.2.
Language : c++; Operating System: winXP
the problem code is as followed:
Eigen::Matrix3d mOrigin;
/* initial mOrigin */
...
Eigen::Quaterniond qOrigin(mOrigin);
I debuged the program and found that when it runs :
Eigen::Quaterniond qOrigin(mOrigin);
it comes out the assertion and prints:
assertion failed: (reinterpret_cast(array) & 0xf) == 0 && "this assertion is explained here: " "http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAssert.html" " **** READ THIS WEB PAGE !!
! ****" in function Eigen::internal::plain_array::plain_array() [with T = double, int Size = 4, int MatrixOrArrayOptions = 0] at C:/WindRiver-GPPVE-3.6-IA-Eval/vxworks-6.6/target/h/Eigen/src/Core/DenseStorage.h:78
it said, fixed-size vectorizable Eigen objects must absolutely be created at 16-byte-aligned locations, otherwise SIMD instructions adressing them will crash. And that is why the assertion arises.
I think the problem is:
Compiler making a wrong assumption on stack alignment
http://eigen.tuxfamily.org/dox-devel/group__TopicWrongStackAlignment.html
it said, It appears that this was a GCC bug that has been fixed in GCC 4.5. If you hit this issue, please upgrade to GCC 4.5 and report to us, so we can update this page.
However, GCC is the intergation compiler of Workbench and I don't know how to upgrade it.
And I think I have tested the Local Solution and Global Solution, but they don't work.
Local Solution:
add "__attribute__((force_align_arg_pointer))"
class Interpolation : public InterpMath/*,public Colleague*/
{
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
...
__attribute__((force_align_arg_pointer)) ErrorID LineInterp(
const Position_MCS_rad &targetPoint,
const Position_MCS_rad &originPoint,
const Position_ACS_rad &originACS,
double Ts, double maxVel, double maxAcc,
double maxDecel, double maxJerk,
N_AxisSeqPtr &nAglSeqPtr, GrpTcpSeq *pGrpTcp = NULL)
{
Eigen::Matrix3d mOrigin;
/* initial mOrigin */
...
Eigen::Quaterniond qOrigin(mOrigin);
}
}
warning: 'force_align_arg_pointer' attribute directive ignored
Global Solution:
add compile option -mstackrealign
ccpentium -g -mtune=pentium4 -march=pentium4 -ansi -Wall -MD -MP -Xlinker -mstackrealign -IC:/WindRiver-GPPVE-3.6-IA-Eval/vxworks-6.6/target/h -IC:/WindRiver-GPPVE-3.6-IA-Eval/vxworks-6.6/target/h/wrn/coreip -IC:/WindRiver-GPPVE-3.6-IA-Eval/workspace/RobotInterface_2_2/h -DCPU=PENTIUM4 -DTOOL_FAMILY=gnu -DTOOL=gnu -D_WRS_KERNEL -o
So how can I upgrade the intergration compiler to gcc 4.5 or newer, or whether there is other solution to fix this problem ?
Thanks for reading and help.
I'm trying to install code which I've successfully installed in the past on a new computer, and am running into problems.
This is on Fedora, using scons. The previous successful installation was on Ubuntu.
When I type scons, it gives the following error:
/usr/bin/ld: cannot find -latlas
I have successfully installed atlas-devel via yum.
If it helps, you'll find below the top level SConstruct File (--- indicates redacted code)
BUILD_LIB_DIR = '#build/lib'
BUILD_INCLUDE_DIR = '#build/include'
BUILD_BIN_DIR = '#build/bin'
import os
default_env = Environment(ENV = os.environ, # use the system $PATH variable
CCFLAGS = ['-pipe', '-Wall'],
CXXFLAGS = ['-std=c++0x'],
CPPPATH = [BUILD_INCLUDE_DIR, '#src/'],
LIBPATH = [BUILD_LIB_DIR],
CPPDEFINES = ['_USE_LCM_'])
default_env.Append(LIBS = [---, 'lapack', 'blas', 'atlas', 'armadillo', 'rt'])
default_env.Alias('install', [BUILD_LIB_DIR, BUILD_INCLUDE_DIR, BUILD_BIN_DIR])
# Create the command-line options along with help text
vars = Variables()
vars.Add(BoolVariable('debug', 'Compile in debug mode with -g and -pg', 0))
vars.Add(EnumVariable('---'))
vars.Add(BoolVariable('log-data', 'Define LOG_DATA in the preprocessor so internal state of modules will be written to log files', 0))
Help(vars.GenerateHelpText(default_env))
debug = ARGUMENTS.get('debug', 0)
log = ARGUMENTS.get('log-data', 0)
if int(debug):
default_env.Append(CCFLAGS = ['-g', '-pg'])
default_env.Append(LINKFLAGS = ['-pg'])
else:
default_env.Append(CCFLAGS = ['-O3'])
if int(log):
default_env.Append(CPPDEFINES = ['LOG_DATA'])
log_env = default_env.Clone();
log_env.Append(LIBS=['global', 'readlog', 'z'])
Export(['default_env', 'log_env', 'BUILD_LIB_DIR', 'BUILD_INCLUDE_DIR', 'BUILD_BIN_DIR', ---])
SConscript(['src/SConscript',
'docs/SConscript'])
It turns out the issue was that atlas puts the libatlas.so in /usr/lib(64)/atlas/...
Thanks to #Dave_Bacher for information on how to deal with this, namely
Add /usr/lib/atlas to the LIBPATH array in your default_env:
LIBPATH = [BUILD_LIB_DIR, /usr/lib/atlas]
I'm a security officer on this iSeries, using PASE (Portable Application Security Environment -- essentially a virtual AIX-like sandbox on OS/400) to compile Ghostscript 9.05. I've downloaded and installed RPM for AIX in my PASE environment, and then used the RPMs for gcc (gcc-4.0.0-1.aix5.3.ppc) and the rest of a standard GNU dev environment to install them on PASE, as well. Configure works fine (within /QOpenSys/usr/bin/-sh, I use CALL QP2TERM to get there), but when I then attempt gmake (make defaults to cc instead of gcc here), it fails immediately with:
$ pwd
/QOpenSys/download/ghostscript-9.05/ghostscript-9.05
$ gmake
Makefile:1: *** missing separator. Stop.
I read the previous question on this, and purged my Makefile.in of comments and ran it through cat -vet Makefile.in. Results are included below; they look fine to me, but I still receive the error above. (Note that this was pulled from a 5250 emulator session; line breaks in the display do not correlate with Makefile.in line breaks, which are shown as a $ instead):
$ cat -vet Makefile.in
BINDIR=./$(BUILDDIRPREFIX)bin$
GLSRCDIR=./base$
GLGENDIR=./$(BUILDDIRPREFIX)#OBJDIR_BSDMAKE_WORKAROUND#$
GLOBJDIR=./$(BUILDDIRPREFIX)#OBJDIR_BSDMAKE_WORKAROUND#$
AUXDIR=$(GLGENDIR)/aux$
PSSRCDIR=./psi$
PSLIBDIR=./lib$
PSRESDIR=./Resource$
PSGENDIR=./$(BUILDDIRPREFIX)#OBJDIR_BSDMAKE_WORKAROUND#$
PSOBJDIR=./$(BUILDDIRPREFIX)#OBJDIR_BSDMAKE_WORKAROUND#$
CONTRIBDIR=./contrib$
include $(GLSRCDIR)/version.mak$
DD=$(GLGENDIR)/$
GLD=$(GLGENDIR)/$
PSD=$(PSGENDIR)/$
INSTALL = $(GLSRCDIR)/instcopy -c$
INSTALL_PROGRAM = $(INSTALL) -m 755$
INSTALL_DATA = $(INSTALL) -m 644$
INSTALL_SHARED = #INSTALL_SHARED#$
prefix = #prefix#$
exec_prefix = #exec_prefix#$
bindir = #bindir#$
scriptdir = $(bindir)$
includedir = #includedir#$
libdir = #libdir#$
mandir = #mandir#$
man1ext = 1$
man1dir = $(mandir)/man$(man1ext)$
datadir = #datadir#$
datarootdir = #datarootdir#$
gsdir = #datadir#/ghostscript$
gsdatadir = $(gsdir)/$(GS_DOT_VERSION)$
gssharedir = #libdir#/ghostscript/$(GS_DOT_VERSION)$
gsincludedir = #includedir#/ghostscript/$
docdir=$(gsdatadir)/doc$
exdir=$(gsdatadir)/examples$
GS_DOCDIR=$(docdir)$
CUPSCFLAGS=#CUPSCFLAGS#$
CUPSLIBS=#CUPSLIBS#$
CUPSLIBDIRS=#CUPSLIBDIRS#$
CUPSSERVERBIN=#CUPSSERVERBIN#$
CUPSSERVERROOT=#CUPSSERVERROOT#$
CUPSDATA=#CUPSDATA#$
CUPSPDFTORASTER=#CUPSPDFTORASTER#$
CUPSINSTTARGET=#CUPSINSTALL#$
COMPILE_INITS=#COMPILE_INITS#$
GS_LIB_DEFAULT=$(gsdatadir)/Resource/Init:$(gsdatadir)/lib:$(gsdatadir)/Resou
rce/Font:$(gsdir)/fonts:#fontpath#$
GS_CACHE_DIR="~/.ghostscript/cache/"$
SEARCH_HERE_FIRST=0$
GS_INIT=gs_init.ps$
GENOPT=$
CAPOPT= #HAVE_MKSTEMP# #HAVE_FILE64# #HAVE_MKSTEMP64# #HAVE_FONTCONFIG# #HAVE
_LIBIDN# #HAVE_SETLOCALE# #HAVE_SSE2# #HAVE_DBUS# #HAVE_BSWAP32# #HAVE_BYTESW
AP_H#$
GS=#GS##EXEEXT#$
DEBUGDIRPREFIX=debug$
MEMENTODIRPREFIX=mem$
PGDIRPREFIX=pg$
FT_BRIDGE=#FT_BRIDGE#$
SHARE_FT=#SHARE_FT#$
FTSRCDIR=#FTSRCDIR#$
FT_CFLAGS=#FT_CFLAGS#$
FT_LIBS=#FT_LIBS#$
FT_CONFIG_SYSTEM_ZLIB=#FT_SYS_ZLIB#$
#INSERT_UFST_BRIDGE_EQUAL_ONE#$
UFST_ROOT=#UFST_ROOT#$
UFST_LIB_EXT=#UFST_LIB_EXT#$
UFST_ROMFS_ARGS?=-b \$
-P $(UFST_ROOT)/fontdata/mtfonts/pcl45/mt3/ -d fontdata/mtfonts/pcl45/mt3/ p
cl___xj.fco plug__xi.fco wd____xh.fco \$
-P $(UFST_ROOT)/fontdata/mtfonts/pclps2/mt3/ -d fontdata/mtfonts/pclps2/mt3/
pclp2_xj.fco \$
-c -P $(PSSRCDIR)/../lib/ -d Resource/Init/ FAPIconfig-FCO$
UFSTROMFONTDIR=\"%rom%fontdata/\"$
UFSTDISCFONTDIR?=\"$(UFST_ROOT)/fontdata/\"$
UFST_CFLAGS=#UFST_CFLAGS#$
JSRCDIR=#LIBJPEGDIR#$
SHARE_JPEG=#SHARE_LIBJPEG#$
JPEG_NAME=jpeg$
SHARE_LIBPNG=#SHARE_LIBPNG#$
PNGSRCDIR=#LIBPNGDIR#$
LIBPNG_NAME=png$
SHARE_LIBTIFF=#SHARE_LIBTIFF#$
TIFFSRCDIR=#LIBTIFFDIR#$
TIFFPLATFORM=unix$
TIFFCONFIG_SUFFIX=$
LIBTIFF_NAME=tiff$
SHARE_ZLIB=#SHARE_ZLIB#$
ZSRCDIR=#ZLIBDIR#$
ZLIB_NAME=z$
JBIG2_LIB=#JBIG2_DECODER#$
SHARE_JBIG2=#SHARE_JBIG2#$
JBIG2SRCDIR=#JBIG2DIR#$
JBIG2_CFLAGS=#JBIG2_AUTOCONF_CFLAGS#$
JPX_LIB=#JPX_DECODER#$
SHARE_JPX=#SHARE_JPX#$
JPXSRCDIR=#JPXDIR#$
JPX_CFLAGS=#JPX_AUTOCONF_CFLAGS#$
ICCSRCDIR=icclib$
SHARE_LCMS=#SHARELCMS#$
LCMSSRCDIR=#LCMSDIR#$
LCMS2SRCDIR=#LCMS2DIR#$
LCMS_CFLAGS=#LCMS_ENDIAN#$
LCMS2_CFLAGS=#LCMS2_ENDIAN#$
WHICH_CMS=#WHICHLCMS#$
SHARE_IJS=#SHAREIJS#$
IJS_NAME=#IJSLIB#$
IJSSRCDIR=#IJSDIR#$
IJSEXECTYPE=unix$
SHARE_LCUPS=#SHARELCUPS#$
LCUPS_NAME=cups$
LCUPSSRCDIR=cups$
LCUPSBUILDTYPE=#LCUPSBUILDTYPE#$
CUPS_CC=$(CC)$
SHARE_LCUPSI=#SHARELCUPSI#$
LCUPSI_NAME=cupsimage$
LCUPSISRCDIR=cups$
CUPS_CC=$(CC)$
AR=ar$
ARFLAGS=qc$
RANLIB=#RANLIB#$
CC=#CC#$
CCAUX=#CC#$
CCLD=$(CC)$
CCAUXLD=$(CCAUX)$
GCFLAGS=#CPPFLAGS# #GCFLAGS# #CFLAGS#$
CFLAGS_STANDARD=#OPT_CFLAGS#$
CFLAGS_DEBUG=#DBG_CFLAGS#$
CFLAGS_PROFILE=-pg #OPT_CFLAGS#$
CFLAGS_SO=#DYNAMIC_CFLAGS#$
AC_CFLAGS=#DYNAMIC_FLAGS#$
FONTCONFIG_CFLAGS=#FONTCONFIG_CFLAGS#$
FONTCONFIG_LIBS=#FONTCONFIG_LIBS#$
DBUS_CFLAGS=#DBUS_CFLAGS#$
DBUS_LIBS=#DBUS_LIBS#$
ACDEFS=#DEFS#$
CFLAGS=$(CFLAGS_STANDARD) $(GCFLAGS) $(AC_CFLAGS) $(XCFLAGS)$
AC_LDFLAGS=#X_LDFLAGS#$
LDFLAGS=#LDFLAGS# $(AC_LDFLAGS) $(XLDFLAGS)$
EXTRALIBS=$(XTRALIBS) #LIBS# #DYNAMIC_LIBS# #FONTCONFIG_LIBS# #FT_LIBS#$
STDLIBS=#PTHREAD_LIBS# -lm$
XINCLUDE=#X_CFLAGS#$
XLIBDIRS=#X_LDFLAGS#$
XLIBDIR=$
XLIBS=#X_LIBS#$
SYNC=#SYNC#$
RM=rm -f$
SOC_CFLAGS^I=^I#SOC_CFLAGS#$
SOC_LIBS^I=^I#SOC_LIBS#$
SOC_LOADER^I=^I#SOC_LOADER#$
FEATURE_DEVS=$(PSD)psl3.dev $(PSD)pdf.dev $(PSD)dpsnext.dev $(PSD)ttfont.dev
$(PSD)epsf.dev $(GLD)pipe.dev $(GLD)gsnogc.dev $(GLD)htxlib.dev $(PSD)fapi.de
v #JBIG2DEVS# #JPXDEVS# #UTF8DEVS#$
FEATURE_DEVS_ALL=$(PSD)psl3.dev $(PSD)pdf.dev $(PSD)dpsnext.dev $(PSD)ttfont.
dev $(PSD)rasterop.dev $(PSD)double.dev $(PSD)trapping.dev $(PSD)stocht.dev $
(GLD)pipe.dev $(GLD)gsnogc.dev $(GLD)htxlib.dev #JBIG2DEVS# #JPXDEVS# #UTF8DE
VS#$
RESOURCE_LIST=Resource/CMap/ Resource/ColorSpace/ Resource/Decoding/ Resource
/Font/ Resource/ProcSet/ Resource/IdiomSet/ Resource/CIDFont/$
BAND_LIST_STORAGE=file$
BAND_LIST_COMPRESSOR=zlib$
FILE_IMPLEMENTATION=stdio$
STDIO_IMPLEMENTATION=c$
GS_DEV_DEFAULT="x11alpha bbox"$
DISPLAY_DEV=$(DD)bbox.dev$
DEVICE_DEVS=$(DISPLAY_DEV) #X11_DEVS#$
DEVICE_DEVS1=#F_DEVS#$
DEVICE_DEVS2=#P_DEVS#$
DEVICE_DEVS3=#CUPS_DEVS#$
DEVICE_DEVS4=#IJS_DEVS#$
DEVICE_DEVS5=#OMNIDEVS#$
DEVICE_DEVS6=#PNG_DEVS#$
DEVICE_DEVS7=#JBIG2_DEVS#$
DEVICE_DEVS8=#SVG_DEVS#$
DEVICE_DEVS9=$
DEVICE_DEVS10=$
DEVICE_DEVS11=$
DEVICE_DEVS12=$
DEVICE_DEVS13=$
DEVICE_DEVS14=$
DEVICE_DEVS15=$
DEVICE_DEVS16=$
DEVICE_DEVS17=$
DEVICE_DEVS18=$
DEVICE_DEVS19=$
DEVICE_DEVS20=$
DEVICE_DEVS21=$
GS_SHARED_OBJS=#DYNAMIC_DEVS#$
MAKEFILE=Makefile$
TOP_MAKEFILES=$(MAKEFILE) $(GLSRCDIR)/unixhead.mak$
AK=$
CCFLAGS=$(GENOPT) $(CAPOPT) $(CFLAGS)$
CC_=$(CC) $(CCFLAGS)$
CCAUX_=$(CCAUX) $(CFLAGS)$
CC_LEAF=$(CC_)$
CC_LEAF_PG=$(CC_)$
CC_NO_WARN=$(CC_)$
CCAUX_NO_WARN=$(CCAUX_)$
CC_SHARED=$(CC_) #DYNAMIC_CFLAGS#$
LD_SET_DT_SONAME=#SET_DT_SONAME#$
FOR_MAC=#SO_FOR_MAC#$
MAKEDIRS=| directories$
MAKEDIRSTOP=$
INSTALL_CONTRIB=#INSTALL_CONTRIB#$
include $(GLSRCDIR)/unixhead.mak$
include $(GLSRCDIR)/gs.mak$
include $(PSSRCDIR)/psromfs.mak$
include $(GLSRCDIR)/lib.mak$
include $(PSSRCDIR)/int.mak$
include $(GLSRCDIR)/freetype.mak$
include $(GLSRCDIR)/jpeg.mak$
include $(GLSRCDIR)/zlib.mak$
include $(GLSRCDIR)/png.mak$
include $(GLSRCDIR)/tiff.mak$
include $(GLSRCDIR)/jbig2.mak$
include $(GLSRCDIR)/jasper.mak$
include $(GLSRCDIR)/ldf_jb2.mak$
include $(GLSRCDIR)/lwf_jp2.mak$
include $(GLSRCDIR)/openjpeg.mak$
include $(GLSRCDIR)/icclib.mak$
include $(GLSRCDIR)/$(WHICH_CMS).mak$
include $(GLSRCDIR)/ijs.mak$
#LCUPSINCLUDE#$
#LCUPSIINCLUDE#$
include $(GLSRCDIR)/devs.mak$
include $(GLSRCDIR)/contrib.mak$
include $(GLSRCDIR)/unix-aux.mak$
include $(GLSRCDIR)/unixlink.mak$
include $(GLSRCDIR)/unix-dll.mak$
include $(GLSRCDIR)/unix-end.mak$
include $(GLSRCDIR)/unixinst.mak$
#CONTRIBINCLUDE#$
#CUPSINCLUDE#$
distclean : clean config-clean soclean pgclean debugclean$
^I-$(RM_) -r $(BINDIR) $(GLOBJDIR) $(PSOBJDIR) $(AUXDIR)$
^I-$(RM_) -r autom4te.cache$
^I-$(RM_) config.log config.status$
^I-$(RM_) Makefile$
^I#-rmdir $(BINDIR) $(GLOBJDIR) $(PSOBJDIR)$
^I-$(RM_) $(TIFFSRCDIR)$(D)libtiff$(D)tif_config.h $(TIFFSRCDIR)$(D)libtiff$(
D)tiffconf.h$
debug-clean : debugclean$
memento-clean : mementoclean$
maintainer-clean : distclean$
^I-$(RM_) configure.ac$
^I-$(RM_) configure$
^I-$(RM_) Makefile.in$
check : default$
^I$(NO_OP)$
Figured this out. Full details and steps to reproduce are here: http://hewhocutsdown.net/blog/2012/04/25/how-to-compile-ghostscript-for-pase/
It came down to three items:
Using gcc 4.2.0 instead of older versions.
Running configure with the –build=”powerpc-ibmaix5.3.0.0” option.
Apply an AIX-specific patch to opj_malloc.h (an OpenJPEG libray), patch here: http://openjpeg.googlecode.com/issues/attachment?aid=1390001000&name=Issue_139-AIX-memalign.patch&token=fTYKtT77eCQohWNtP2epWWxP2xQ%3A1335385237594
gmake most likely does not do any character conversion, so it just reads raw EBCDIC.
Check the CCSID on the IFS file is 819.
(My usual trick for creating an empty file is touch -C 819 file. Also if at all possible compile on native AIX)
What's the value of the environment variable BUILDDIRPREFIX? Should it end with a '/'?