sox-devel@lists.sourceforge.net unofficial mirror
 help / color / mirror / code / Atom feed
From: Ulrich Klauer <ulrich@chirlu.de>
To: sox-devel@lists.sourceforge.net
Subject: Re: New 14.4.1 Windows binary?
Date: Sun, 10 Feb 2013 16:34:46 +0100	[thread overview]
Message-ID: <20130210163446.Horde.FKJRZ1NNcXdRF74W67PR0tA@webmail.df.eu> (raw)
In-Reply-To: <CAGzDe_ZX2t3BS7CH639kksGKL6zWgn_nEPkR-SnctDrpQcne3w@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1168 bytes --]

Chris Bagwell <chris@cnpbagwell.com>:

> flac-1.2.1/src/libFLAC/bitwriter.c:286: undefined reference to  
> `_imp__ntohl@4'

> I haven't found time to look into it yet but the reason I made that change
> to mingwbuild is because of sox git commit
> d0647a4f8650f92057274f2412bb8aa79f71a242 .  If I recall correctly, I was
> getting duplicate symbol failure.
>
> I obvious didn't realize I was totally disabling FLAC/libsndfile. I thought
> I was getting rid of duplicate symbol.
>
> So any fix is likely more than a compile change.

Ah, I see. I have a few ideas that I'd like to try out, unfortunately  
I can't get cross-compiling to work here (not enough motivation  
either, I guess). Here are two patches, but I can't say whether one of  
them really solves the problem:
- One reverts the relevant part of commit d0647a4. It then should be  
possible again to link against wsock32.dll as done in previous releases.
- The other one removes the -no-undefined flag (commit d0647a4 did  
this, too, but it has since found its way back) in the hope that this  
will allow the linker to match the ntohl() call from libflac and the  
definition from src/flac.c.

Ulrich

[-- Attachment #2: 0001-Link-Windows-build-to-wsock32.dll-again.patch --]
[-- Type: text/x-patch, Size: 1775 bytes --]

>From b4f833707729d52d720c37736fc6121569b884ba Mon Sep 17 00:00:00 2001
From: Ulrich Klauer <ulrich@chirlu.de>
Date: Sun, 10 Feb 2013 15:56:13 +0100
Subject: [PATCH] Link Windows build to wsock32.dll again

Link the Windows build to wsock32.dll for ntohl() again instead of
trying to provide an own implementation.

(Partial revert of commit d0647a4f8650f92057274f2412bb8aa79f71a242.)
---
 configure.ac |    5 +++++
 src/flac.c   |    8 --------
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/configure.ac b/configure.ac
index ea7fd11..48e8ca2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -437,6 +437,11 @@ AC_OPTIONAL_FORMAT(oggvorbis, OGG_VORBIS, [AC_CHECK_HEADER(vorbis/codec.h,
 #  support for OGG and if OGG libraries are found on this
 #  system then its highly likely to be compiled into FLAC
 #  and will require these at link time.
+case $target in
+  *mingw*)
+  FLAC_LIBS="-lwsock32"
+  ;;
+esac
 AC_OPTIONAL_FORMAT(flac, FLAC, [AC_CHECK_HEADER(FLAC/all.h, [AC_CHECK_DECL(FLAC_API_VERSION_CURRENT, [AC_CHECK_LIB(FLAC, FLAC__stream_encoder_new, FLAC_LIBS="-lFLAC $FLAC_LIBS $OGG_VORBIS_LIBS",using_flac=no, $FLAC_LIBS $OGG_VORBIS_LIBS)], using_flac=no, [#include <FLAC/all.h>])], using_flac=no)], using_flac=no)
 
 
diff --git a/src/flac.c b/src/flac.c
index eff2ae4..2eba0f1 100644
--- a/src/flac.c
+++ b/src/flac.c
@@ -55,14 +55,6 @@ typedef struct {
 } priv_t;
 
 
-#if defined(__MINGW32__)
-/* Provide a local definition of ntohl so we don't need to load wsock32.dll. */
-unsigned long __stdcall ntohl(unsigned long val)
-{
-    return lsx_swapdw(val);
-}
-#endif
-
 
 static void FLAC__decoder_metadata_callback(FLAC__StreamDecoder const * const flac, FLAC__StreamMetadata const * const metadata, void * const client_data)
 {
-- 
1.7.10.4


[-- Attachment #3: 0001-Remove-no-undefined-flag-for-MinGW-build.patch --]
[-- Type: text/x-patch, Size: 727 bytes --]

>From 007a085ce9348c24df0d08d117c6b0a4bf9b7eb1 Mon Sep 17 00:00:00 2001
From: Ulrich Klauer <ulrich@chirlu.de>
Date: Sun, 10 Feb 2013 16:10:43 +0100
Subject: [PATCH] Remove -no-undefined flag for MinGW build

Remove the -no-undefined linker flag for MinGW builds. Hopefully, this
will allow the linker to match the ntohl() call from libflac and the
definition provided in src/flac.c.
---
 configure.ac |    1 -
 1 file changed, 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index ea7fd11..62d784d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -46,7 +46,6 @@ AC_LIBTOOL_DLOPEN
 case $target in
   *cygwin* | *mingw*)
   AC_LIBTOOL_WIN32_DLL
-  APP_LDFLAGS="-no-undefined"
    ;;
 esac
 AC_PROG_LIBTOOL
-- 
1.7.10.4


[-- Attachment #4: Type: text/plain, Size: 255 bytes --]

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb

[-- Attachment #5: Type: text/plain, Size: 158 bytes --]

_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel

  reply	other threads:[~2013-02-10 15:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-09  1:04 New 14.4.1 Windows binary? Ulrich Klauer
2013-02-09  3:27 ` Chris Bagwell
2013-02-09 16:40   ` Ulrich Klauer
2013-02-10  3:39     ` Chris Bagwell
2013-02-10 15:34       ` Ulrich Klauer [this message]
2013-02-11  4:05         ` Chris Bagwell
2013-03-09 19:25           ` Chris Bagwell
2013-03-10  6:00             ` Ulrich Klauer
2013-03-11  3:38               ` Chris Bagwell
2013-02-12 20:16         ` bat guano
2013-02-18 14:13           ` bat guano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.sourceforge.net/lists/listinfo/sox-devel

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130210163446.Horde.FKJRZ1NNcXdRF74W67PR0tA@webmail.df.eu \
    --to=sox-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/sox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).