From scm at ipl.t.u-tokyo.ac.jp Mon May 22 09:28:31 2006 From: scm at ipl.t.u-tokyo.ac.jp (Shin-Cheng Mu) Date: Mon May 22 09:21:50 2006 Subject: [nhc-bugs] ld: Undefined symbols on OS X when compiling with -t Message-ID: <161AEE6A-CE41-4AFF-97BC-0FB5D6331CA0@ipl.t.u-tokyo.ac.jp> Hi, I just installed NHC98 using Darwin Ports on a PowerPC G4 based Mac, running OS X 10.4 with GCC 4.0. NHC works fine without profiling options. When I turned on time profiling, however, NHC98 appears to have problems linking: scm$ cat text.hs main = print (foldr (+) 0 [1..10000]) scm$ hmake -nhc98 -t text nhc98 -t -c -o text.z.o text.hs nhc98 -t -o text text.z.o /tmp/tprofusr3456.c: In function 'tprofTMInitTreeUsr': /tmp/tprofusr3456.c:21: warning: incompatible implicit declaration of built-in function 'strdup' /usr/bin/ld: Undefined symbols: _FN_NHC_46Internal_46_95apply1 _FN_NHC_46Internal_46_95apply2 _TMSUB_NHC_46DErrNo _TM_NHC_46DErrNo _TMSUB_NHC_46PackedString _TM_NHC_46PackedString collect2: ld returned 1 exit status Is it a bug, or is something missing in Darwin Ports? sincerely, Shin-Cheng Mu From Malcolm.Wallace at cs.york.ac.uk Mon May 22 09:53:03 2006 From: Malcolm.Wallace at cs.york.ac.uk (Malcolm Wallace) Date: Mon May 22 09:51:34 2006 Subject: [nhc-bugs] ld: Undefined symbols on OS X when compiling with -t In-Reply-To: <161AEE6A-CE41-4AFF-97BC-0FB5D6331CA0@ipl.t.u-tokyo.ac.jp> References: <161AEE6A-CE41-4AFF-97BC-0FB5D6331CA0@ipl.t.u-tokyo.ac.jp> Message-ID: <20060522145303.648c9c07.Malcolm.Wallace@cs.york.ac.uk> Shin-Cheng Mu wrote: > scm$ hmake -nhc98 -t text > nhc98 -t -c -o text.z.o text.hs > nhc98 -t -o text text.z.o > /usr/bin/ld: Undefined symbols: > _FN_NHC_46Internal_46_95apply1 > _FN_NHC_46Internal_46_95apply2 > _TMSUB_NHC_46DErrNo > _TM_NHC_46DErrNo > _TMSUB_NHC_46PackedString > _TM_NHC_46PackedString > > Is it a bug, or is something missing in Darwin Ports? This is a bug. Unfortunately, the time-profiling code has not been properly maintained or tested since it was contributed to the main compiler branch. (The reason for this particular breakage is that time-profiling relies on a post-processor for object files after they have been built, and this has some some hand-coded hacks for internal Prelude-like definitions. When the runtime internals changed, these hacks were not kept in sync.) Regards, Malcolm From scm at iis.sinica.edu.tw Mon May 22 09:39:42 2006 From: scm at iis.sinica.edu.tw (Shin-Cheng Mu) Date: Fri Jun 2 08:13:57 2006 Subject: [nhc-bugs] Bus Error and Segmentation Fault when Heap Profiling is On Message-ID: <7D6EED92-927D-474C-863C-B16120CF2B28@iis.sinica.edu.tw> Hi, This is another potential bug. Unfortunately I currently cannot reproduce it on smaller programs. I tried to do heap profiling on the following code: http://www.psdlab.org/~scm/hx.tar.gz The main program is hxpc.hs. I tried to compile it with hmake -nhc98 -p hxpc and run it on a small sample input scm$ cat > temp.xml 123 scm$ ./hxpc temp.xml Bus error scm$ ./hxpc temp.xml +RTS -p Segmentation fault Increasing the heap size does not seem to help. If I compile the program without the -p option, it runs fine. Since Malcolm Wallace has already profiled the program on his machine, it seems to be a platform specific problem I installed NHC98 1.18_4 using Darwin Ports, on a PowerPC G4 based Mac, running OS X 10.4 and GCC 4.0. sincerely, Shin-Cheng Mu