Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#57872 closed defect (fixed)

gnutls @3.6.5: error: thread-local storage is unsupported for the current target

Reported by: mrkapqa Owned by: Schamschula (Marius Schamschula)
Priority: Normal Milestone:
Component: ports Version: 2.5.4
Keywords: snowleopard leopard tiger Cc: kencu (Ken)
Port: gnutls

Description (last modified by ryandesign (Ryan Carsten Schmidt))

Hello

Sudo port upgrade outdated 

failed with Gnutls-3.6.5

--->  Fetching distfiles for gnutls
--->  Attempting to fetch gnutls-3.6.5.tar.xz from http://lil.fr.distfiles.macports.org/gnutls
--->  Verifying checksums for gnutls                                            
--->  Extracting gnutls
--->  Applying patches to gnutls
--->  Configuring gnutls
--->  Building gnutls
Error: Failed to build gnutls: command execution failed

Attachments (2)

gnutls.log (1.0 MB) - added by mrkapqa 5 years ago.
mpv-gnutls.log (1.0 MB) - added by mrkapqa 5 years ago.

Change History (23)

Changed 5 years ago by mrkapqa

Attachment: gnutls.log added

comment:1 Changed 5 years ago by mrkapqa

Please see attached log file

Thank you!

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

Cc: kencu added
Description: modified (diff)
Keywords: snowleopard tiger added; mpv gnutls snow removed
Owner: set to Schamschula
Status: newassigned
Summary: (Gnutls-3.6.5@SnowLeoopard) - Failed to build gnutls - command execution failedgnutls @3.6.5: error: thread-local storage is unsupported for the current target

Indeed, thread-local storage is not supported on Snow Leopard or earlier. Ken has done some work into fixing that... Has that gotten any closer to being ready?

comment:3 Changed 5 years ago by mrkapqa

Hello ,

thank you so much for helping with this. Could you please show also how to checkout correctly mpv@0.22 with all the libraries from that time? i could not setup it correctly, so that it would build with the depdendencies of that particular git checkout; it seems that mpv always wants to build with latest dependencies.

comment:4 Changed 5 years ago by kencu (Ken)

Thread_local is now working for all systems, using clang-5.0 through clang-7.0, and is rolled out to the main repo (you can get it by using the cxx11 1.1 PG). Thread_local also works on gcc48 and up, for completeness of comment.

(BTW, I also fixed mpv, so don't bother with any fancy checking out older versions business, just install it and you should be fine -- if not, let me know what goes wrong.)

comment:5 Changed 5 years ago by kencu (Ken)

I should say gnutls won't build for me anyway, due to :

In file included from psk.c:41:
./psktool-args.h:63:3: error: option template version mismatches autoopts/options.h header
# error option template version mismatches autoopts/options.h header
  ^
./psktool-args.h:64:3: error: unknown type name 'Choke'
  Choke Me.
  ^
./psktool-args.h:64:11: error: expected ';' after top level declarator
  Choke Me.
          ^
          ;

which I am led to believe from this <https://lists.gnupg.org/pipermail/gnutls-devel/2015-August/007721.html> we might be able to fix by autoreconf-ing it or autoconf-ing it (I am still not clear on what the difference is between those two).

comment:6 Changed 5 years ago by kencu (Ken)

well we already do autoreconf it, so that's not going to help. Must be some other solution...

comment:7 in reply to:  4 Changed 5 years ago by mrkapqa

Replying to kencu:

(BTW, I also fixed mpv, so don't bother with any fancy checking out older versions business, just install it and you should be fine -- if not, let me know what goes wrong.)

Thank you, it would not install on my Core CPU MacPro1.1/2.1, could it be because it is missing SSE4 extension set?

Sudo port install mpv always fails@029.1. to apply patches ony va computer.

comment:8 Changed 5 years ago by kencu (Ken)

If you

sudo port clean mpv
sudo port selfupdate
sudo port -v install mpv

you should not see any patch failures since the last commit I did in December.

if you do, please show me a log so I can see why that might be happening.

Best,

Ken

comment:9 Changed 5 years ago by Schamschula (Marius Schamschula)

Indeed, I also saw this failure on the buildbots last night.

Unfortunately, I no longer have any sufficiently old machines in working condition to explore this issue.

comment:10 Changed 5 years ago by mrkapqa

Ken, please see additional log;

i do have older computer running, so if there is anything i can do to help, please let me know it(your-average-user).

Changed 5 years ago by mrkapqa

Attachment: mpv-gnutls.log added

comment:11 Changed 5 years ago by kencu (Ken)

So you should find mpv to be fixed on 10.6.8:

$ port -v installed mpv
The following ports are currently installed:
  mpv @0.29.1_2+audiocd+dvd+libarchive+network+opengl+osd+python27+rubberband+x11 (active) platform='darwin 10' archs='x86_64' date='2018-12-16T10:25:41-0800'

if not, please open a ticket about mpv with a build log and I'll help sort that out.

Regarding gnutls, the thread_local thing is trivial to fix as above, but that doesn't fix the build of gnutls, unfortunately.

comment:12 in reply to:  5 Changed 5 years ago by Schamschula (Marius Schamschula)

Replying to kencu:

I should say gnutls won't build for me anyway, due to :

In file included from psk.c:41:
./psktool-args.h:63:3: error: option template version mismatches autoopts/options.h header
# error option template version mismatches autoopts/options.h header
  ^
./psktool-args.h:64:3: error: unknown type name 'Choke'
  Choke Me.
  ^
./psktool-args.h:64:11: error: expected ';' after top level declarator
  Choke Me.
          ^
          ;

which I am led to believe from this <https://lists.gnupg.org/pipermail/gnutls-devel/2015-August/007721.html> we might be able to fix by autoreconf-ing it or autoconf-ing it (I am still not clear on what the difference is between those two).

It looks like you need to add --enable-local-libopts to the configure.args

See comment near the bottom of https://github.com/appneta/tcpreplay/issues/430

comment:13 Changed 5 years ago by Schamschula (Marius Schamschula)

Oh wait. I already had that...

comment:14 Changed 5 years ago by Schamschula (Marius Schamschula)

On the other hand, one could try --enable-libopts-install instead.

comment:15 Changed 5 years ago by kencu (Ken)

thanks, I'll try that

comment:16 Changed 5 years ago by kencu (Ken)

sadly that didn't work. however there is a way:

$ port -v installed gnutls
The following ports are currently installed:
  gnutls @3.6.5_0+doc (active) platform='darwin 10' archs='x86_64' date='2019-01-08T19:51:10-0800'

I'm not sure how / why exactly yet, but this:

$ git diff
diff --git a/devel/gnutls/Portfile b/devel/gnutls/Portfile
index 98fb484487..9fdead8190 100644
--- a/devel/gnutls/Portfile
+++ b/devel/gnutls/Portfile
@@ -54,15 +54,10 @@ post-patch {
     reinplace {/^#/d} {*}[glob ${worksrcpath}/lib/accelerated/x86/macosx/*.s]
 }
 
-# use autoreconf to update glibtool to correctly handle -std
-use_autoreconf  yes
-autoreconf.args -fvi
-
 configure.args  --disable-guile \
                 --disable-silent-rules \
                 --disable-libdane \
                 --disable-doc \
-                --enable-local-libopts \
                 --enable-openssl-compatibility \
                 --with-p11-kit \
                 --with-system-priority-file="${prefix}/etc/gnutls/default-priorities" \

plus building with clang-5.0, plus deactivating autoconf and autogen, plus building in trace mode, plus having my system defaulting to libc++ -- some or all of that -- allowed it to build.

comment:17 Changed 5 years ago by kencu (Ken)

ok, the secret seems to be disabling autogen - the build fails if that is active (which makes sense).

comment:18 Changed 5 years ago by hidikal (Andrew Norrie)

I required these changes to the current portfile, https://github.com/macports/macports-ports/commit/8ca67432c550eeaecb8f280930d4be8069180ccb, to build on Snow Leopard.

--- /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/devel/gnutls/Portfile	2019-01-12 23:06:44.000000000 +1000
+++ devel/gnutls/Portfile	2019-01-14 10:36:48.000000000 +1000
@@ -145,6 +145,11 @@
     compiler.blacklist-append {clang < 400}
 }
 
+platform darwin 10 {
+    compiler.blacklist-append macports-clang-3.4
+    compiler.whitelist-append macports-clang-5.0
+}
+
 livecheck.type  regex
 livecheck.url   [lindex ${master_sites} 0]
 livecheck.regex "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"

The blacklist clang < 400 does not catch macports-clang-3.4 and macports-clang-5.0 is not selected without adding to the whitelist.

comment:19 Changed 5 years ago by kencu (Ken)

I will put something temporary together. There is a major rewrite to MacPorts' compiler selection coming shortly, but too many people are messed up by this in the meantime.

comment:20 Changed 5 years ago by kencu (Ken)

Resolution: fixed
Status: assignedclosed

In af306457a542a7f4a77bb82e2d2bd339476f87d9/macports-ports (master):

gnutls: force a thread_local supporting compiler

also need a newer NM on some older systems
closes: #57872

comment:21 Changed 5 years ago by kencu (Ken)

I made a meaningful attempt to resolve this. Too much code, but we'll see if we've covered off all the bases with it. Best of luck, buildbots!

Note: See TracTickets for help on using tickets.