lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Can't build "Working example" from BUILDING


From: Grant Edwards
Subject: Re: [lwip-users] Can't build "Working example" from BUILDING
Date: Thu, 30 Sep 2021 15:11:22 -0000 (UTC)
User-agent: slrn/1.0.3 (Linux)

On 2021-09-29, Grant Edwards <grant.b.edwards@gmail.com> wrote:

> I'm trying to get started porting lwIP to an RTOS. Having never
> worked with lwip before, I thought I would first just build
> 2_1_3_RC1 for Linux. I'm following the directions in BUILDING:

Can somebody point me to documentation or an example showing how to
build lwip?  Just building a simple demo app using the unix port would
be great.

I primarily want to build lwip as a library, because I have several
different applications which will be then be build using that
library. I do not want to set up a cmake/makefile that builds an
entire application executable (including lwip) from sources.

I have a clear idea of what I need to do for the OS port and for the
Ethernet driver, and have code I'd like to start testing for
both. But, I can't figure out how to actually _build_ lwip.

I've beeing trying to follow 
https://git.savannah.nongnu.org/cgit/lwip.git/tree/BUILDING
as a starting point, but it appears to be out-of-date and not
applicable to recent versions. For example, it clearly states that the
'contrib' directory should be a subdirectory of the root lwip source
directory. IOW, contrib is a sibling of doc, src, text, CHANGELOG,
UPGRADING, etc.

But I _think_, based on the error messages seen when running cmake,
that the actual cmake files assume that contrib and lwip are
siblings. IOW, contrib needs to be located one directory level "up"
from where BUILDING states it is located.

In the "Working example" section of BUILDING, it says to create a
'build' directory underneath the lwip root directory and then do
'cmake .., etc.' in that build directory. To quote BUILDING:

    To use them, create a build directory and call cmake with the lwIP
    root dir:

     - mkdir build
     - cd build
     - cmake ..
     - cmake --build .

If cmake is being called "with the lwIP root dir" then '..' must be the
lwip rood directory, and 'build' must have been created in the lwip root
directory. AFAICT, that does nothing but attempt to build the documentation.

What apprently needs to be done is:

 1. Move 'contrib' directory up one level.

 2. The shell commands shown in section "Working example" should not
    be done in the lwip root directory as stated. They are done in

        contib/ports/unix/example_app

That appears to attemp to compile source files. But, that fails also:

    $ cmake --build .
    [  1%] Building C object 
CMakeFiles/makefsdata.dir/home/grante/lwip/lwip/src/apps/http/makefsdata/makefsdata.c.o
    /home/grante/lwip/lwip/src/apps/http/makefsdata/makefsdata.c: In function 
‘process_file’:
    /home/grante/lwip/lwip/src/apps/http/makefsdata/makefsdata.c:923:32: error: 
‘sprintf’ may write a terminating nul past the end of the destination 
[-Werror=format-overflow=]
      923 |   sprintf(qualifiedName, "%s/%s", curSubdir, filename);
          |                                ^
    /home/grante/lwip/lwip/src/apps/http/makefsdata/makefsdata.c:923:3: note: 
‘sprintf’ output 2 or more bytes (assuming 257) into a destination of size 256
      923 |   sprintf(qualifiedName, "%s/%s", curSubdir, filename);
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors
    gmake[2]: *** [CMakeFiles/makefsdata.dir/build.make:76: 
CMakeFiles/makefsdata.dir/home/grante/lwip/lwip/src/apps/http/makefsdata/makefsdata.c.o]
 Error 1
    gmake[1]: *** [CMakeFiles/Makefile2:91: CMakeFiles/makefsdata.dir/all] 
Error 2


So, I'm obviously still doing something wrong.

Can anybody lend me a clue?

--
Grant





reply via email to

[Prev in Thread] Current Thread [Next in Thread]