summaryrefslogtreecommitdiff
path: root/utils/hp2ps
Commit message (Collapse)AuthorAgeFilesLines
* Make: Get rid of GHC_INCLUDE_DIRSJohn Ericson2021-11-151-2/+2
| | | | | | These dirs should not be included in all stages. Instead make the per-stage `BUILD_*_INCLUDE_DIR` "plural" to insert `rts/include` in the right place.
* utils: Bump cabal-version of hp2ps and unlitBen Gamari2020-09-091-1/+1
|
* winio: Allow hp2ps to build with -DDEBUGAndreas Klebinger2020-07-151-1/+1
|
* Rename ghcAssert to stgAssert in hp2ps/Main.h.Andreas Klebinger2020-02-081-2/+2
| | | This fixes #17763
* Fix typos, via a Levenshtein-style correctorBrian Wignall2020-01-041-1/+1
|
* Per stage headers, ghc_boot_platform.h -> stage 0 ghcplatform.hJohn Ericson2019-10-042-3/+2
| | | | | | | | | | | | | | | | | | The generated headers are now generated per stage, which means we can skip hacks like `ghc_boot_platform.h` and just have that be the stage 0 header as proper. In general, stages are to be embraced: freely generate everything in each stage but then just build what you depend on, and everything is symmetrical and efficient. Trying to avoid stages because bootstrapping is a mind bender just creates tons of bespoke mini-mind-benders that add up to something far crazier. Hadrian was pretty close to this "stage-major" approach already, and so was fairly easy to fix. Make needed more work, however: it did know about stages so at least there was a scaffold, but few packages except for the compiler cared, and the compiler used its own counting system. That said, make and Hadrian now work more similarly, which is good for the transition to Hadrian. The merits of embracing stage aside, the change may be worthy for easing that transition alone.
* Update Wiki URLs to point to GitLabTakenobu Tani2019-03-252-4/+4
| | | | | | | | | | | | | | | | | | | | | | | This moves all URL references to Trac Wiki to their corresponding GitLab counterparts. This substitution is classified as follows: 1. Automated substitution using sed with Ben's mapping rule [1] Old: ghc.haskell.org/trac/ghc/wiki/XxxYyy... New: gitlab.haskell.org/ghc/ghc/wikis/xxx-yyy... 2. Manual substitution for URLs containing `#` index Old: ghc.haskell.org/trac/ghc/wiki/XxxYyy...#Zzz New: gitlab.haskell.org/ghc/ghc/wikis/xxx-yyy...#zzz 3. Manual substitution for strings starting with `Commentary` Old: Commentary/XxxYyy... New: commentary/xxx-yyy... See also !539 [1]: https://gitlab.haskell.org/bgamari/gitlab-migration/blob/master/wiki-mapping.json
* Fix uninformative hp2ps error when the cmdline contains double quotesZejun Wu2018-12-111-20/+17
| | | | | | | | | | | | | | | | | | | | | | | Reapply D5346 with fix incompatible shell quoting in tests. It seems like `$'string'` is not recognized under all test environments, so let's avoid it in tests. Test Plan: ``` hp2ps: "T15904".hp, line 2: integer must follow identifier ``` use new ghc and hp2ps to profile a simple program. Reviewers: simonmar, bgamari, erikd, tdammers Reviewed By: bgamari Subscribers: tdammers, carter, rwbarton GHC Trac Issues: #15904 Differential Revision: https://phabricator.haskell.org/D5388
* cosmetic change: expandtab in utils/hp2ps/HpFile.cZejun Wu2018-12-111-202/+202
| | | | | | | | | | | | | | | | | rGHCbba2b9bf2d69700dc114118658507aaac34c5e62 expand tabs in utils/hp2ps/HpFile.c with tabwidth 2, but the code was written as tabwidth 8. This change simply retabs the code with tabwidth 8 and removes trailing spaces. Test Plan: Tested in stacked diff: {D5388} Reviewers: simonmar, bgamari, afarmer, tdammers Reviewed By: simonmar Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5407
* Revert "Fix uninformative hp2ps error when the cmdline contains double quotes"Ben Gamari2018-11-241-174/+177
| | | | This reverts commit 390df8b51b917fb6409cbde8e73fe838d61d8832.
* Fix uninformative hp2ps error when the cmdline contains double quotesZejun Wu2018-11-221-68/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The format of hp file didn't allow double quotes inside strings, and under prof build, we include args in JOB, which may have double quotes. When this happens, the error message is confusing to the user. This can also happen under normal build if the executable name contains double quite, which is unlikely though. We fix this issue by introducing escaping for double quotes inside a string by repeating it twice. We also fix a buffer overflow bug when the length of the string happen to be multiple of 5000. Test Plan: new tests, which used to fail with error message: ``` hp2ps: "T15904".hp, line 2: integer must follow identifier ``` use new ghc and hp2ps to profile a simple program. Reviewers: simonmar, bgamari, erikd Reviewed By: simonmar Subscribers: rwbarton, carter GHC Trac Issues: #15904 Differential Revision: https://phabricator.haskell.org/D5346
* Update .cabal files for Cabal 2.1Moritz Angermann2018-02-151-3/+3
| | | | | | | | | | | | | | | cabal introduces SPDX identifier, and as such we need to change the BSD3 license name. Also the >= qualifier is no longer prefered. Test Plan: ./validate Reviewers: bgamari, erikd, simonmar Reviewed By: bgamari Subscribers: alpmestan, rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4406
* Cabalify all the thingsMoritz Angermann2017-11-151-0/+22
| | | | | | | | | | | | | | Adding cabal files to `unlit`, `touchy` and `hp2ps`, allows us to treat them uniformally across the build system. In particular Hadrian will use these. Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D4192
* Prefer #if defined to #ifdefBen Gamari2017-04-283-5/+5
| | | | Our new CPP linter enforces this.
* cpp: Use #pragma once instead of #ifndef guardsBen Gamari2017-04-2319-76/+19
| | | | | | | | | | | | | | This both says what we mean and silences a bunch of spurious CPP linting warnings. This pragma is supported by all CPP implementations which we support. Reviewers: austin, erikd, simonmar, hvr Reviewed By: simonmar Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3482
* cross-build 'unlit' and 'hp2ps' for stage2 installSergei Trofimovich2017-04-081-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | In navive build case it does not matter much if we build 'unlit' and 'hp2ps' tools with ghc-stage0 or ghc-stage1: both GHCs are native compilers and both tools are written in C (have no haskell code). But in cross-case the difference is substantial: In Stag1Only=YES case we need to install native tools built by ghc-stage0/${host}-cc. In Stag1Only=NO case we need to install cross-built tools built by ghc-stage1/${target}-cc. Before this change GHC did not have a rule to build cross-built 'unlit' and 'hp2ps'. The change adds cross-built 'unlit' and 'hp2ps' as 'dist-install' targets. 'inplace/lib/bin/unlit.bin' target is unchanged and still contains native binary. As a result this change allows cross-building and packaging whole GHC for target platform! Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* hp2ps: install shell wrapperSergei Trofimovich2017-04-032-2/+5
| | | | | | | | | | | | | | | | | | Before this change we installed hp2ps both to inplace/bin/ and ${prefix}/bin/ In both cases we added $(CrossCompilePrefix) as a binary prefix. It's incorrect for inplace install as none of inplace binaries are prefixed. The change it to track 'hp2ps' as unprefixed binary. $(CrossCompilePrefix) prefix is only added to the installed shell wrapper. Now 'hp2ps' is handled in a similar way to 'hpc' and 'ghc-pkg'. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* Typos in commentsGabor Greif2016-10-211-1/+1
|
* hp2ps: fix invalid PostScript for names with parenthesesBen Gamari2016-07-171-1/+2
| | | | | | | | | | | | | | | | | The names in the .hp files may contain un-matched opening parentheses, so escape them. GHC Trac: #9517 Reviewers: bgamari, austin Reviewed By: bgamari, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2398 GHC Trac Issues: #9517
* hp2ps: mark local functions as 'static'Sergei Trofimovich2016-02-077-18/+13
| | | | | | | | | | | | | | | | | | Found by uselex.rb: fonttab: [R]: exported from: ./utils/hp2ps/dist/build/Dimensions.o GetString: [R]: exported from: ./utils/hp2ps/dist/build/HpFile.o thestring: [R]: exported from: ./utils/hp2ps/dist/build/HpFile.o auxfp: [R]: exported from: ./utils/hp2ps/dist/build/Main.o dflag: [R]: exported from: ./utils/hp2ps/dist/build/Main.o filter: [R]: exported from: ./utils/hp2ps/dist/build/Main.o iflag: [R]: exported from: ./utils/hp2ps/dist/build/Main.o mflag: [R]: exported from: ./utils/hp2ps/dist/build/Main.o pflag: [R]: exported from: ./utils/hp2ps/dist/build/Main.o psfile: [R]: exported from: ./utils/hp2ps/dist/build/Main.o tflag: [R]: exported from: ./utils/hp2ps/dist/build/Main.o OrderOf: [R]: exported from: ./utils/hp2ps/dist/build/Reorder.o Signed-off-by: Sergei Trofimovich <siarheit@google.com>
* Fix `hp2ps -i-`Thomas Miedema2015-09-151-0/+1
| | | | | | | From the help text: -i[+|-] sort by identifier string (-i+ gives greatest on top) Found by David Binderman.
* Fix identifier parsing in hp2psYuras Shumovich2015-08-291-21/+23
| | | | | | | | | | | | | | | | | Now identifiers can start with a package key, which is a hash, so they may also start with a digit. Identifiers always appear at the beginning of a line, and numbers never appear here, soit's safe to allow identifiers to start with a digit. Test Plan: `concprog002` passes under `threaded2_hT` way Reviewers: austin, bgamari, thomie Reviewed By: austin, bgamari, thomie Differential Revision: https://phabricator.haskell.org/D1175 GHC Trac Issues: #10661
* Delete _MSC_VER when not necessary, fix #10511Bernard Desmyter2015-06-121-1/+1
| | | | | | | Simplify some preprocessor expressions involving `_MSC_VER` because `_WIN32` is always defined when `_MSC_VER` is. Differential Revision: https://phabricator.haskell.org/D981
* Removes all occurrences of __MINGW32__ (#10485)Thomas Miedema2015-06-111-1/+1
| | | | | | | | | | In Haskell files, replace `__MINGW32__` by `mingw32_HOST_OS`. In .c and .h files, delete `__MINGW32__` when `_WIN32` is also tested because `_WIN32` is always defined when `__MINGW32__` is. Also replace `__MINGW32__` by `_WIN32` when used standalone for consistency. Differential Revision: https://phabricator.haskell.org/D971
* Add a cast to new code in hp2psReid Barton2014-06-301-1/+1
| | | | | For parallelism with the existing code. I don't think it should make any difference.
* Avoid integer overflow in hp2ps (#9145)Reid Barton2014-06-301-3/+8
| | | | | This is slightly hackish, but hp2ps is already convoluted enough that I don't feel bad about it.
* Fix memleak in hp2psNicolas Trangez2014-04-271-0/+2
| | | | | | Issue discovered by Coverity scan, CID 43167. Signed-off-by: Austin Seipp <austin@well-typed.com>
* Fix potential out-of-bound memory accessNicolas Trangez2014-04-271-2/+2
| | | | | | Issue discovered by Coverity scan, CID 43165. Signed-off-by: Austin Seipp <austin@well-typed.com>
* Document -c in hp2hs(1)Joachim Breitner2013-10-171-0/+2
| | | | This fixes #8452.
* Globally replace "hackage.haskell.org" with "ghc.haskell.org"Simon Marlow2013-10-012-4/+4
|
* Make validate play nice with clang (for Xcode 5 command line tools)Manuel M T Chakravarty2013-09-041-4/+8
| | | | * This partially fixes #8148. However, --with-ghc-4.8 will still not work given the rather dubious m4 macros and the failures in the test suite due to '-nodefaultlibs' still need to be fixed.
* Typo in hp2ps help outputJoachim Breitner2013-06-131-1/+1
| | | | As spotted by Julian Gilbey and reported at http://bugs.debian.org/710305
* Automatically add the $(exeext) to program namesIan Lynagh2013-03-031-1/+1
| | | | | | | We now define _PROGNAME, and _PROG is automatically defined with $(exeext). This will shortly automatically use the right exeext depending on what stage it is being compiled with (exeext may be different for different stages when cross-compiling).
* add $(CrossCompilePrefix) to hp2ps (#7639)Simon Marlow2013-02-011-1/+1
|
* Build the dynamic way by default on Linux/amd64Ian Lynagh2012-10-031-7/+8
| | | | | | | | | | | | | This required various build system changes to get the build to go through. In the inplace shell wrappers, we set LD_LIBRARY_PATH to allow programs to find their libraries. In the future, we might change the inplace tree to be the same shape as an installed tree instead. However, this would mean changing the way we do installation, as currently we use cabal's installation methods to install the libraries, but that only works if the libraries are under libraries/foo/dist-install/build/..., rather than in inplace/lib/...
* escape(): don't forget the final '\0'Simon Marlow2012-05-231-0/+1
| | | | | Hopefully should fix random "bad heap profile" failures in the nightly builds.
* hp2ps: escape backslashes when generating output file (#5800).Paolo Capriotti2012-03-221-2/+20
|
* RefactoringIan Lynagh2012-01-081-1/+1
| | | | | This is working towards being able to put ghcautoconf.h and ghcplatform.h in includes/dist
* Remove some antiquated C constructsIan Lynagh2011-08-0118-144/+85
| | | | | | | | Fixes validate on amd64/Linux with: SRC_CC_OPTS += -Wmissing-parameter-type SRC_CC_OPTS += -Wold-style-declaration SRC_CC_OPTS += -Wold-style-definition
* Handle EXTRA_LIBRARIES when building programsIan Lynagh2010-09-301-1/+1
| | | | And set hp2ps's EXTRA_LIBRARIES. Based on a patch from Sergei Trofimovich.
* Link programs that have no Haskell objects with gcc rather than ghcIan Lynagh2010-07-161-0/+1
|
* Detect EOF when trying to parse a string in hp2psIan Lynagh2010-05-061-1/+4
|
* Fix hp2ps when the .hp file has large string literalsIan Lynagh2010-05-051-4/+13
|
* Add -Iincludes to hp2ps's CC_OPTSIan Lynagh2009-12-081-0/+2
| | | | Making C deps for hp2ps always failed, but we used to carry on regardless
* Add a header to all build system files:Simon Marlow2009-04-282-0/+24
| | | | | | | | | | | | | | # ----------------------------------------------------------------------------- # # (c) 2009 The University of Glasgow # # This file is part of the GHC build system. # # To understand how the build system works and how to modify it, see # http://hackage.haskell.org/trac/ghc/wiki/Building/Architecture # http://hackage.haskell.org/trac/ghc/wiki/Building/Modifying # # -----------------------------------------------------------------------------
* GHC new build system megapatchIan Lynagh2009-04-263-21/+14
|
* bindists are now some way towards workingIan Lynagh2008-08-101-4/+2
|
* FIX #1955: confusion between .exe.hp and .hp suffixes for heap profilesSimon Marlow2008-05-191-1/+0
| | | | Now we use <prog>.hp and <prog>.prof consistently.
* Mac OS X deployment target: piping opts through MakefilesManuel M T Chakravarty2008-02-211-0/+3
|
* Fix bindist creationIan Lynagh2007-06-011-0/+5
| | | | | Bindists should now work again, when doing "make install" at least. "make in-place" is probably still broken.