Opened 12 years ago

Closed 9 years ago

#34275 closed defect (fixed)

pdftk should not depend on gcc42

Reported by: jharmon@… Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.0.4
Keywords: Cc: ballapete (Peter "Pete" Dyballa), cooljeanius (Eric Gallager), maehne (Torsten Maehne), petrrr, burdges (Jeff Burdges)
Port: pdftk

Description

The summary says it all!

Attachments (2)

main.log (2.7 MB) - added by jharmon@… 12 years ago.
Log file
Portfile (3.7 KB) - added by burdges (Jeff Burdges) 9 years ago.
textproc/pdftk/Portfile

Change History (26)

Changed 12 years ago by jharmon@…

Attachment: main.log added

Log file

comment:1 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: changed from macports-tickets@… to mww@…
Summary: gcc 42 failed to buildgcc42 failed to build: -lgcc_s.10.4 is not an object file

I see you're on OS X 10.5 Intel, but the error message is "-lgcc_s.10.4 is not an object file". At first glance, that seems weird...

Do you really need gcc42? There are several newer versions of gcc available in MacPorts.

comment:2 Changed 12 years ago by jharmon@…

Thanks so much for looking into this! I suspect gcc42 is a dependency of something critical, unfortunately. So, it's kinda not up to me...! Maybe it's a variant issue somehow? I don't know why it should be referencing 10.4 at all.. Thanks again!

Jeff

comment:3 Changed 12 years ago by jharmon@…

i appreciate everyone's efforts a great deal! macports is such a vital part of the community. i'm hoping someone might get to this bug, and thought it might be helpful to communicate that this still presents a problem, at least for us. thanks!

comment:4 Changed 12 years ago by fiee (Henning Hraban Ramm)

Same problem here, just upgraded to MacPorts 2.1.0 on OSX 10.5.8 Intel. gcc42 is a dependency of pdftk in my case, but that should also build with gcc45.

comment:5 Changed 12 years ago by jharmon@…

almost two months and we're still unable to upgrade our ports because of this gcc42 problem. help!

comment:6 Changed 12 years ago by jharmon@…

i upgraded to 2.1.1 and it still happens

comment:7 Changed 12 years ago by mww@…

Several points:

  • The bug really seems weird
  • I cannot reproduce it as I do not have a machine with 10.5
  • We try hard to run on the two latest version of OS X -- 10.5 is a legacy platform (and gcc42 does not even build on 10.6 anymore at all)

To fix this problem the best way would be to fix pdfkt to not require gcc42; the gcc people do not develop this old branch anymore so there will be nothing coming from upstream that will fix this issue. If you supply me with a patch to fix gcc42 on 10.5 I will happily integrate it, but I am out of ressources here.

Last edited 12 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:8 Changed 12 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Owner: changed from mww@… to ryandesign@…
Port: pdftk added; gcc42 removed
Summary: gcc42 failed to build: -lgcc_s.10.4 is not an object filepdftk should not depend on gcc42

gcc42 should be removed. Please try this out:

Index: Portfile
===================================================================
--- Portfile	(revision 97745)
+++ Portfile	(working copy)
@@ -54,6 +54,36 @@
 
 set versuff ""
 
+variant gcc43 conflicts gcc44 gcc45 gcc47 description {Build using gcc43} {
+    configure.compiler  macports-gcc-4.3
+    depends_lib-append  port:gcc43
+    set versuff         -mp-4.3
+}
+
+variant gcc44 conflicts gcc43 gcc45 gcc47 description {Build using gcc44} {
+    configure.compiler  macports-gcc-4.4
+    depends_lib-append  port:gcc44
+    set versuff         -mp-4.4
+}
+
+variant gcc45 conflicts gcc43 gcc44 gcc47 description {Build using gcc45} {
+    configure.compiler  macports-gcc-4.5
+    depends_lib-append  port:gcc45
+    set versuff         -mp-4.5
+}
+
+variant gcc47 conflicts gcc43 gcc44 gcc45 description {Build using gcc47} {
+    configure.compiler  macports-gcc-4.7
+    depends_lib-append  port:gcc47
+    set versuff         -mp-4.7
+}
+
+if {${os.platform} == "darwin" && ${os.major} < 11} {
+    default_variants    +gcc45
+} else {
+    default_variants    +gcc47
+}
+
 pre-configure {
     if {![file exists ${prefix}/bin/gcj${versuff}]} {
         return -code error "
@@ -80,37 +110,3 @@
     xinstall -m 644 -W ${worksrcpath} pdftk.1 \
         ${destroot}${prefix}/share/man/man1
 }
-
-variant gcc42 conflicts gcc45 gcc47 description {Build using gcc42} {
-    patchfiles-append   patch-gcj-4.2-and-older.diff
-    configure.compiler  macports-gcc-4.2
-    depends_build-append port:fastjar
-    depends_lib-append  port:gcc42
-    set versuff         -mp-4.2
-}
-
-variant gcc45 conflicts gcc42 gcc47 description {Build using gcc45} {
-    configure.compiler  macports-gcc-4.5
-    depends_lib-append  port:gcc45
-    set versuff         -mp-4.5
-}
-
-variant gcc47 conflicts gcc42 gcc45 description {Build using gcc47} {
-    configure.compiler  macports-gcc-4.7
-    depends_lib-append  port:gcc47
-    set versuff         -mp-4.7
-}
-
-if {![variant_isset gcc42] && ![variant_isset gcc45] && ![variant_isset gcc47]} {
-    if {${os.platform} == "darwin"} {
-        if {${os.major} < 10} {
-            default_variants    +gcc42
-        } elseif {${os.major} < 11} {
-            default_variants    +gcc45
-        } else {
-            default_variants    +gcc47
-        }
-    } else {
-        default_variants    +gcc45
-    }
-}

comment:9 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

I had never been able to build pdftk with gcc43, gcc44 or gcc46; that is why the port only contains gcc42, gcc45 and gcc47 variants. See #22066 for more on this.

comment:10 Changed 12 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Ok, well what about this then:

Index: Portfile
===================================================================
--- Portfile	(revision 97759)
+++ Portfile	(working copy)
@@ -81,36 +81,22 @@
         ${destroot}${prefix}/share/man/man1
 }
 
-variant gcc42 conflicts gcc45 gcc47 description {Build using gcc42} {
-    patchfiles-append   patch-gcj-4.2-and-older.diff
-    configure.compiler  macports-gcc-4.2
-    depends_build-append port:fastjar
-    depends_lib-append  port:gcc42
-    set versuff         -mp-4.2
-}
-
-variant gcc45 conflicts gcc42 gcc47 description {Build using gcc45} {
+variant gcc45 conflicts gcc47 description {Build using gcc45} {
     configure.compiler  macports-gcc-4.5
     depends_lib-append  port:gcc45
     set versuff         -mp-4.5
 }
 
-variant gcc47 conflicts gcc42 gcc45 description {Build using gcc47} {
+variant gcc47 conflicts gcc45 description {Build using gcc47} {
     configure.compiler  macports-gcc-4.7
     depends_lib-append  port:gcc47
     set versuff         -mp-4.7
 }
 
-if {![variant_isset gcc42] && ![variant_isset gcc45] && ![variant_isset gcc47]} {
-    if {${os.platform} == "darwin"} {
-        if {${os.major} < 10} {
-            default_variants    +gcc42
-        } elseif {${os.major} < 11} {
-            default_variants    +gcc45
-        } else {
-            default_variants    +gcc47
-        }
+if {![variant_isset gcc45] && ![variant_isset gcc47]} {
+    if {${os.platform} == "darwin" && ${os.major} < 11} {
+        default_variants    +gcc45
     } else {
-        default_variants    +gcc45
+        default_variants    +gcc47
     }
 }
Last edited 12 years ago by jeremyhu (Jeremy Huddleston Sequoia) (previous) (diff)

comment:11 Changed 12 years ago by jeremyhu (Jeremy Huddleston Sequoia)

BTW, tracking eventual removal of gcc42 in #33919

comment:12 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

pdftk's build process has been extremely fragile in the past, and certain versions of gcc seemed to work better on certain OS versions; that is why the port's code was written the way it was. I do not know if using gcc45 to build pdftk on Leopard and Tiger works. I do know that on Lion and Mountain Lion using anything less than gcc47 seems not to work.

If the gcc47 variant works for all users on all platforms I'd be happy to just leave that and remove the rest. However not too long ago it was not possible to build gcc47 on PowerPC; I'm not sure if that was ever fixed. Certainly right now would be a poor time to try to test this, since other problems have been introduced into the gcc4* ports in the past few days that need to be ironed out first, before I go spending days of CPU time trying to compile the gcc4* updates on my Power Mac.

comment:13 Changed 12 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Well gcc42 doesn't build on Leopard, so we need to do something about that.

I believe gcc47 still does not build on darwin/ppc, but it's a long thread in #34385. It looks like someone at the end has been able to build it, but I don't have a ppc machine available to try it out on...

comment:14 Changed 11 years ago by ballapete (Peter "Pete" Dyballa)

Cc: Peter_Dyballa@… added

Cc Me!

comment:15 in reply to:  12 Changed 11 years ago by ballapete (Peter "Pete" Dyballa)

Replying to ryandesign@…:

If the gcc47 variant works for all users on all platforms I'd be happy to just leave that and remove the rest. However not too long ago it was not possible to build gcc47 on PowerPC; I'm not sure if that was ever fixed. Certainly right now would be a poor time to try to test this, since other problems have been introduced into the gcc4* ports in the past few days that need to be ironed out first, before I go spending days of CPU time trying to compile the gcc4* updates on my Power Mac.

In Fink I could build GCC 4.7.2 on Leopard, Mac OS X 10.5.8, G4. Jack Howarth, Fink's maintainer of that package, could build GCC 4.7.2 on a G5.

My own success is a bit troublesome. The first two tries failed here:

	Comparing stages 2 and 3
	warning: gcc/cc1-checksum.o differs
	warning: gcc/cc1obj-checksum.o differs
	warning: gcc/cc1objplus-checksum.o differs
	warning: gcc/cc1plus-checksum.o differs
	Bootstrap comparison failure!
	gcc/host-darwin.o differs

Such files were built then:

3084 10 Okt 20:39 gcc47-4.7.2-1000/darwin_objdir/stage1-gcc/cc1-checksum.o
3092 10 Okt 20:45 gcc47-4.7.2-1000/darwin_objdir/stage1-gcc/cc1plus-checksum.o

 512 11 Okt 02:56 gcc47-4.7.2-1000/darwin_objdir/stage2-gcc/cc1-checksum.o
 512 11 Okt 03:44 gcc47-4.7.2-1000/darwin_objdir/stage2-gcc/cc1plus-checksum.o
 512 11 Okt 04:42 gcc47-4.7.2-1000/darwin_objdir/stage2-gcc/cc1obj-checksum.o
 512 11 Okt 04:49 gcc47-4.7.2-1000/darwin_objdir/stage2-gcc/cc1objplus-checksum.o

2776 11 Okt 07:47 gcc47-4.7.2-1000/darwin_objdir/stage3-gcc/cc1-checksum.o
2784 11 Okt 07:57 gcc47-4.7.2-1000/darwin_objdir/stage3-gcc/cc1plus-checksum.o
2784 11 Okt 08:13 gcc47-4.7.2-1000/darwin_objdir/stage3-gcc/cc1obj-checksum.o
2792 11 Okt 08:14 gcc47-4.7.2-1000/darwin_objdir/stage3-gcc/cc1objplus-checksum.o

5544 10 Okt 20:37 gcc47-4.7.2-1000/darwin_objdir/stage1-gcc/host-darwin.o
1728 11 Okt 02:52 gcc47-4.7.2-1000/darwin_objdir/stage2-gcc/host-darwin.o
5876 11 Okt 07:44 gcc47-4.7.2-1000/darwin_objdir/stage3-gcc/host-darwin.o

Interestingly I had a disk low warning around the time when the build finished with the error message. At the time when the differing files were created the disk had enough space. I then decided to build GCC 4.7.2 on a different volume, which is used to hold the swap files and was intended to also hold virtual systems. While the original volume has HFSX with a journal, the other volume has HFS without a journal. The compilation on that volume succeeded – like that:

	Comparing stages 2 and 3
	warning: gcc/cc1-checksum.o differs
	warning: gcc/cc1obj-checksum.o differs
	warning: gcc/cc1objplus-checksum.o differs
	warning: gcc/cc1plus-checksum.o differs
	Comparison successful.

And then the build process continued with:

	if false; then \
	  rm -rf stage2-*; \
	  echo timestamp >  stage2-lean; \
	fi

In that build I cannot find the stage2-gcc and stage3-gcc directories…

Last year it succeeded to build GCC 4.7.1.

comment:16 Changed 11 years ago by jeremyhu (Jeremy Huddleston Sequoia)

gcc4[789] are reported to work on ppc now (see #34385). Can we get some motion on this, so we can remove gcc42?

Last edited 11 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:17 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

My uncommitted patch for updating the port to 2.0.1 (see #37580) removes PowerPC support, since I was unable to compile pdftk with gcj from gcc45 or gcc47. But if gcc48 and gcc49 should compile, I'll install them and give it a try.

comment:18 Changed 11 years ago by cooljeanius (Eric Gallager)

Cc: egall@… added

Cc Me!

comment:19 Changed 11 years ago by maehne (Torsten Maehne)

Cc: Torsten.Maehne@… added

Cc Me!

comment:20 Changed 10 years ago by petrrr

Cc: petr@… added

Cc Me!

comment:21 Changed 9 years ago by petrrr

What about this ticket? I guess there is no intention to fix gcc42 for older platforms. So shouldn't we drop +gcc42, by now?

comment:22 Changed 9 years ago by burdges (Jeff Burdges)

Why does pdftk have gcc as a library dependency? Surely the gcc variants are only a build dependency, no? At least that way it'd be fine to uninstall an old version of gcc without needing to uninstall pdftk too.

Also, gcc48 and gcc49 should be added since they presumably build pdftk just fine.

And finally : Is it really impossible to build pdftk with Xcode?

comment:23 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: burdges@… added

When you ask a question in a ticket, please Cc yourself so that you will be notified of the answer.

pdftk is written in Java so it needs a Java compiler. Xcode does not provide one. gcc does. gcc47 appears to build pdftk successfully. gcc48 and later do not, that is why variants have not been added for those versions.

Right now, pdftk sets configure.compiler which changes the C and C++ compilers as well as the Java compiler, and thus makes the software link with the gcc libraries. So technically it should have a build dependency on e.g. gcc47 and a library dependency on libgcc. I am not certain why setting configure.compiler does not cause that to happen.

It may be possible to have the port build with the default C/C++ compiler while switching only the Java compiler, and that this would remove the need for the libgcc dependency. This would be preferable and I will try it.

Changed 9 years ago by burdges (Jeff Burdges)

Attachment: Portfile added

textproc/pdftk/Portfile

comment:24 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: newclosed

Please note that attaching a file to a ticket does not generate a notification; only writing a comment in a ticket does. Also, if you're proposing a change, please provide a unified diff, not a complete new Portfile.

In r129035 I've committed my update to the port which includes removing the gcc42 variant and thus resolves this ticket.

Re my previous comment about possibly removing the gcc* library dependency: compiling with gcj (the Java compiler) means that the executable will link with libgcj, so removing the gcc* library dependency won't be possible.

Note: See TracTickets for help on using tickets.