Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 421975 - dev-libs/libf2c - 20090407-main.patch breaks Fortran code compiled with f2c
Summary: dev-libs/libf2c - 20090407-main.patch breaks Fortran code compiled with f2c
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Science Related Packages
URL:
Whiteboard:
Keywords:
: 434204 (view as bug list)
Depends on:
Blocks: 428948
  Show dependency tree
 
Reported: 2012-06-19 14:41 UTC by Evgeny Stambulchik
Modified: 2012-09-07 11:14 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
weak_alias for main (foo.patch,1.33 KB, patch)
2012-09-03 18:22 UTC, Kacper Kowalik (Xarthisius) (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Evgeny Stambulchik 2012-06-19 14:41:17 UTC
"MAIN__();" is a _call_ to Fortran's equivalent of main(), as output by f2c... <grin>Replacing it with "return(0)" may be nice for teraflop record breaking, but is rather disappointing for real calculations</grin>. Please remove the patch.
Comment 1 Justin Lecher (RETIRED) gentoo-dev 2012-08-31 07:04:28 UTC
+*libf2c-20110801-r1 (31 Aug 2012)
+
+  31 Aug 2012; Justin Lecher <jlec@gentoo.org> libf2c-20090407-r1.ebuild,
+  -libf2c-20110801.ebuild, +libf2c-20110801-r1.ebuild, metadata.xml:
+  Drop main.patch, #421975
+
Comment 2 Kacper Kowalik (Xarthisius) (RETIRED) gentoo-dev 2012-09-03 18:22:51 UTC
Created attachment 322838 [details, diff]
weak_alias for main

could you try to link f2c to fortran with following patch?
Comment 3 Kacper Kowalik (Xarthisius) (RETIRED) gentoo-dev 2012-09-03 18:51:21 UTC
correction try that, for the 2nd bit:
--- /dev/null
+++ b/main_foo.c
@@ -0,0 +1,10 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+
+void missing_MAIN__ (void)
+{
+  fprintf(stderr, "The Fortran main program is missing.\n");
+  abort();
+}
+void MAIN__ (void) __attribute__ ((weak, alias("missing_MAIN__")));
Comment 4 Evgeny Stambulchik 2012-09-04 06:53:09 UTC
(In reply to comment #3)
> correction try that, for the 2nd bit:
> --- /dev/null
> +++ b/main_foo.c
> @@ -0,0 +1,10 @@
> +#include <stdio.h>
> +#include <stdlib.h>
> +
> +
> +void missing_MAIN__ (void)
> +{
> +  fprintf(stderr, "The Fortran main program is missing.\n");
> +  abort();
> +}
> +void MAIN__ (void) __attribute__ ((weak, alias("missing_MAIN__")));

Thanks, I see no side effects. Not sure about exotic archs (or non-gcc), though.
Comment 5 Justin Lecher (RETIRED) gentoo-dev 2012-09-04 07:03:57 UTC
okay. I will add this back then.
Comment 6 Justin Lecher (RETIRED) gentoo-dev 2012-09-04 07:09:44 UTC
+*libf2c-20110801-r2 (04 Sep 2012)
+
+  04 Sep 2012; Justin Lecher <jlec@gentoo.org> -libf2c-20110801-r1.ebuild,
+  +libf2c-20110801-r2.ebuild, +files/libf2c-20110801-main.patch:
+  Adding new main() patch, #421975
+
Comment 7 Johannes Huber (RETIRED) gentoo-dev 2012-09-07 11:14:08 UTC
*** Bug 434204 has been marked as a duplicate of this bug. ***