On Linux/powerpc, using the "Dl" unit breaks ParamCount
Original Reporter info from Mantis: Michalis @michaliskambi
-
Reporter name: Michalis Kamburelis
Original Reporter info from Mantis: Michalis @michaliskambi
- Reporter name: Michalis Kamburelis
Description:
This is very similar to the bugreport #29587 (closed) . But #29587 (closed) was for powerpc64 architecture, and the fix was powerpc64-specific. I checked and the same problem affects powerpc architecture, so possibly it needs an analogous fix.
The issue: If I use in my program the "Dl" unit, then ParamCount is always -1. And ArgC is always 0. Attaching a trivial testcase.
I tested this using Debian-provided FPC version (3.0.0+dfsg-2), I did not test using pristine FPC version from freepascal.org, I did not test using branches/fixes_3_0 or trunk version. Apologies in advance if the problem is already solved upstream (I would appreciate the FPC SVN revision number of the fix then, so it can be eventually backported on Debian).
Example session:
$ fpc testpars.lpr
Free Pascal Compiler version 3.0.0+dfsg-2 [2016/01/28] for powerpc
Copyright (c) 1993-2015 by Florian Klaempfl and others
Target OS: Linux for PowerPC
Compiling testpars.lpr
Assembling program
Linking testpars
/usr/bin/ld.bfd: warning: link.res contains output sections; did you forget -T?
10 lines compiled, 0.1 sec
$ ./testpars 1 2 3
0
/home/michalis/testpars : Got -1 command-line parameters:
# ater commenting out "uses Dl;" and recompiling, result is fine:
$ ./testpars 1 2 3
4
/home/michalis/testpars : Got 3 command-line parameters:
1
2
3
Mantis conversion info:
- Mantis ID: 29594
- OS: Debian GNU/Linux
- OS Build: sid(unstable)
- Platform: powerpc
- Version: 3.0.0
- Fixed in version: 3.1.1
- Fixed in revision: 34368 (#80fc6a45)
- Monitored by: » paul.gevers (Paul Gevers)